If, then statement in Excel
Solved/Closed
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.
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.
Related:
- If, then statement in Excel
- Fenix internet on bank statement - Guide
- Gif in excel - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Number to words in excel - Guide
- Marksheet in excel - Guide
3 responses
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 18, 2010 at 06:57 AM
Feb 18, 2010 at 06:57 AM
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)))
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)))
YES!! It worked. Thank you rizvisa1. You don't know how much time you have saved a Soldier for the next 10 months.
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Feb 18, 2010 at 09:27 AM
Feb 18, 2010 at 09:27 AM
Glad to know that I could help some one. Stay safe.