If, then statement in Excel [Solved/Closed]

Report
-
 Fergie -
Hello,

This formula sounds easy to come up with, but I cannot figure it out. I'm trying to figure out how to add a certain amount of days to a date from one cell within another cell, if the third cell has either one text or another.

So here's exactly what it looks like. Cell a1=travel start date, b1=Leave or pass, c1=return date

I want Cell c1 to automatically add either 21 (leave) or 10 (pass) days to cell a1 and show the return date based on cell b1 being either leave or pass. Seems simple, but I'm at a lost for getting the cell b1 criteria in the formula.

I would appreciate any help. Thanks.

3 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
760
Assumptions
1. A1 is a date
2. If a1 or b1 is blank, then nothing is to be seen in c1
3. If b1 is neither Leave or Pass nor blank, then show in c1 same date as a1

Put this in c1 and format the c1 to be a date in the format that you desire/

=IF(OR(A1="",B1=""),"",A1+IF(B1="Leave",21,IF(B1="Pass",10,0)))
2
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

YES!! It worked. Thank you rizvisa1. You don't know how much time you have saved a Soldier for the next 10 months.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
760
Glad to know that I could help some one. Stay safe.
Thanks. I was using an IF-ERROR statement in Office 2010 and when I saved it to an earlier version it didn't recognize the formulas. I changed the IF-ERROR formulas to IF-OR-THEN and everything worked fine even though it said I might have compatibility issues when saving to the earlier version.