close

I would like to write a formula that looks at one cell and sees if there is a
certain letter, R, L or C. and depending on what letter is there it would add
so many days to another date. I am sure I did it before but I do not
remember how I did it. Can anyone help?

=if(a1=quot;Rquot;,5,if(a1=quot;Lquot;,7,if(a1=quot;Cquot;,10,quot;input errorquot;)))
If you've got more than three or four such conditions, you'll be better
served by using a vlookup.

quot;MikeLquot; wrote:

gt; I would like to write a formula that looks at one cell and sees if there is a
gt; certain letter, R, L or C. and depending on what letter is there it would add
gt; so many days to another date. I am sure I did it before but I do not
gt; remember how I did it. Can anyone help?

Use a nested IF statement. Say the original date is in cell A1 and the
letter R, L, or C is in B1 and you want to add 1 for R, 2 for L and 3 for C,
in cell C1 (which should be formatted as a Date) enter the formula
=IF(B1=quot;Rquot;,A1 1,IF(B1=quot;Lquot;,A1 2,IF(B1=quot;Cquot;,A1 3)))

Modify the formula to reflect the correct cells and the desired additional
days.

quot;MikeLquot; wrote:

gt; I would like to write a formula that looks at one cell and sees if there is a
gt; certain letter, R, L or C. and depending on what letter is there it would add
gt; so many days to another date. I am sure I did it before but I do not
gt; remember how I did it. Can anyone help?

Hi Mike

Supposing your date in B1 and the value you are testing is in A1.
Assuming want to add say 5 days for R, 3 days for L or 7 days for C
=B1 5*(A1=quot;Rquot;) 3*(A1=quot;Lquot;) 7*(A1=quot;Cquot;)

--
Regards

Roger Govierquot;MikeLquot; gt; wrote in message
...
gt;I would like to write a formula that looks at one cell and sees if
gt;there is a
gt; certain letter, R, L or C. and depending on what letter is there it
gt; would add
gt; so many days to another date. I am sure I did it before but I do not
gt; remember how I did it. Can anyone help?
one way
in another cell say b1 =if(a1=quot;Rquot;,1,if(a1=quot;Lquot;,2,3))
in another cell have =another date B1
--
paul
remove nospam for email addy!
quot;MikeLquot; wrote:

gt; I would like to write a formula that looks at one cell and sees if there is a
gt; certain letter, R, L or C. and depending on what letter is there it would add
gt; so many days to another date. I am sure I did it before but I do not
gt; remember how I did it. Can anyone help?


Try this formula

=B1 LOOKUP(A1,{quot;Cquot;,quot;Lquot;,quot;Rquot;;1,2,3})--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=501254

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()