A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Good morning Tracy,
Yes, that makes perfect sense.
If cell E contains either a date or the text "N/A", you can combine both requirements in a single formula using IF.
Excel
=IF(E2="N/A","N/A",E2-B2)
This formula will:
- Return N/A if E2 contains the text
"N/A". - Otherwise calculate the number of days between B2 and E2.
If you prefer the result to always be a whole number of days, you can use:
=IF(E2="N/A","N/A",DATEDIF(B2,E2,"d"))
Example
| B (Start Date) | E (End Date) | F (Result) |
| 01/01/2026 | 10/01/2026 | 9 |
| 01/01/2026 | N/A | N/A |
If your workbook uses actual Excel error values (#N/A) instead of the text "N/A", the formula would be slightly different:
=IF(ISNA(E2),"N/A",E2-B2)
Most likely, if users are typing N/A into the cell, the first formula is the one you need.
Best regard, Yves