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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
=IF(AX8="A",AR8+20,IF(AX8="B",AR8+40))

i tried this and it works for "A" but not "B"?
 
Upvote 0
Can't follow your explanation, but do you mean:

=IF(A2=A1,B2+20,IF(A2=B1,B2+20,0))
 
Upvote 0
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,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

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
Back
Top