Help on excel formula using IF

Microsoft Microsoft excel 2007 (pc)
January 28, 2011 at 10:17:57
Specs: Windows XP
I need to create a formula in which one cell contains a value (1, 2, 3, 4, or 5). Based on that value, another cell containing a date will add either 30 or 60 days.

1 = 30
2:5 = 60

I've started with the following formula: =IF(I4=1, F4+30). This works.

When I add the following - it breaks: =IF((I4=1, F4+30), IF(I4=2:5, F4=60))

Any help would be appreciated!

See More: Help on excel formula using IF

Report •

January 28, 2011 at 10:42:31
2:5 is not a syntax that Excel can recognize.

You have a few choices.

If your criteria is fairly simple, e.g. only the integers 1 - 5 will ever appear in I4, then your criteria is actually 1 or not 1:

=IF(I4=1, F4+30, F4+60)

If you really need to check for the specific values, then try this:

=IF(I4=1, F4+30, IF(OR(I4=2, I4=3, I4=4, I4=5), F4+60, ""))

This might even work for you...

=IF(I4=1, F4+30, IF(AND(I4>1, I4<6), F4+60, ""))

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

January 28, 2011 at 11:47:04
Thanks. They both worked perfectly!!! I appreciate the help!

Report •

March 15, 2011 at 05:48:05
I have a similar issue, If a cell contains the letter "Y" for yes, then I need to multiply a different cell by .01. I know I've done this before but at my advanced age I can't remember how?

Report •

Related Solutions

Ask Question