Formula to add days to a date

sbaily

Board Regular
Joined
May 13, 2007
Messages
162
Hi

I need to able to create a formula to look at cell A2 if it equal to A then to look at cell b2 and add 20 days if A2 is equal to B then it should look at b2 but at 40 days

Cheers
 
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

sbaily

Board Regular
Joined
May 13, 2007
Messages
162
=IF(AX8="A",AR8+20,IF(AX8="B",AR8+40))

i tried this and it works for "A" but not "B"?
 
Upvote 0

Yard

Well-known Member
Joined
Nov 5, 2008
Messages
1,929
Can't follow your explanation, but do you mean:

=IF(A2=A1,B2+20,IF(A2=B1,B2+20,0))
 
Upvote 0

Yard

Well-known Member
Joined
Nov 5, 2008
Messages
1,929
Oh now I understand your question (now you've put the "A" and "B" in quotes!)

Your formula is fine apart from an unspecified value_if_false in your second IF statement:

=IF(AX8="A",AR8+20,IF(AX8="B",AR8+40,"something here if neither A nor B"))
 
Upvote 0

Forum statistics

Threads
1,195,683
Messages
6,011,137
Members
441,587
Latest member
kbsgiri09

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top