EXCEL Formula Question

Tracy Romeo 20 Reputation points
2026-07-30T14:10:57.9766667+00:00

Good Morning,

I need to put two formulas into one Excel cell.
I want the cell to: 1) calculate the number of days between two dates, and 2) if the cell with the second date contains N/A, the calculated cell will indicate N/A.

image

I have figured out how to calculate the number of days between cells B and C (D).

For Cell F, I need two formulas:

  1. If cell E has a date, calculate the number of days between B and E and
  2. If cell E says N/A, enter N/A

I hope this makes sense.

Thank you in advance,
Tracy Romeo

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author

MATHIEU, Yves 80 Reputation points
2026-07-30T14:28:41.7366667+00:00

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

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.