How can I have multiple "If" statements in one formula?

M

MikeL

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?
 
B

bpeltzer

=if(a1="R",5,if(a1="L",7,if(a1="C",10,"input error")))
If you've got more than three or four such conditions, you'll be better
served by using a vlookup.
 
S

SVC

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="R",A1+1,IF(B1="L",A1+2,IF(B1="C",A1+3)))

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

Roger Govier

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="R")+3*(A1="L")+7*(A1="C")
 
P

paul

one way
in another cell say b1 =if(a1="R",1,if(a1="L",2,3))
in another cell have =another date+B1
 
Top