Share via

A nested IF function where a date cell that is either empty or contains a non-date value returns the "" value for elapsed time

Anonymous
2012-06-07T15:00:10+00:00

I am trying to create a nested IF function in Excel 2010 so, if the date in cell B2 is empty, then the elapsed number of days in cell C2 stays empty, and if cell B2 contains an "N/A" text value, the cell C2 stays empty; but if cell B2 does contain a date, the cell C2 shows the elapsed number of days

Here’s my formula so far:

=IF(B2="","",IF(B2="N/A"),"",B2-A2)

Here’s what I need:

6/6/12   6/7/12   1

6/6/12                  “”

N/A                       “”

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-06-07T15:08:14+00:00

slight change in syntax:

=IF(B2="","",IF(B2="N/A","",B2-A2))

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-06-07T15:42:34+00:00

    This works. Thanks, Mr. Student!

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-06-07T15:11:22+00:00

    Just move your closing bracket to the end

    =IF(B2="","",IF(B2="N/A","",B2-A2))

    Alternatively use the OR

    =IF(OR(B2="",B2="N/A"),"",B2-A2)

    Was this answer helpful?

    0 comments No comments