Function Problems

How to Display N/A for Blank Date Cells Using Excel Formulas

Algirdas JasaitisAlgirdas Jasaitis Nov 3, 2026 870 views

Question details

The user wants a formula to display "N/A" when either of two date cells is empty, and to calculate the date difference only when both cells have valid dates.

How to Display N/A When Date Cells Are Blank in Excel
Product
Excel
Device & OS
not provided
Scenario
Calculating the difference between two dates dynamically while preventing incorrect calculations or errors when one or both dates are missing.
Observed behavior
Instead of returning an error or calculating an invalid date difference, the target cell accurately displays "N/A" when a date is missing.
Before you start

Verify that your date cells are properly formatted as Date or Numeric values, as the COUNT function specifically looks for numbers and will ignore text strings.

Solution 1Recommended

Use the IF and COUNT Functions

Combine the IF and COUNT functions to verify both cells contain numbers (dates) before executing the subtraction.

The COUNT function tallies the number of numeric values within a range. Because Excel treats dates as serial numbers, COUNT will return 2 if both date cells are properly filled. The IF function then uses this condition to determine whether to subtract the dates or output "N/A".

1
Select the target cell

Click on the cell where you want the date difference or "N/A" to be displayed (for example, E4).

2
Enter the formula

Type the formula =IF(COUNT(C4:D4)<2,"n/a",D4-C4) into the formula bar.

3
Apply and fill down

Press Enter to apply the formula. Click and drag the small square fill handle at the bottom-right corner of the cell to copy the formula down to the rest of your column.

Alternative Formula: You can also write the formula as =IF(COUNT(C4:D4)=2,D4-C4,"n/a"). Both versions achieve the exact same result.
Advanced Spreadsheet Capabilities

Calculate Date Differences Seamlessly with WPS Spreadsheet

WPS Spreadsheet fully supports all advanced logical and statistical formulas, including IF, COUNT, and ISBLANK. You can easily manage complex datasets and automate your workflow with high accuracy.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your date columns.
  2. 2. Apply the logic formula: Select an empty cell and input =IF(COUNT(A1:B1)=2,B1-A1,"N/A"), replacing A1 and B1 with your actual date cell references.
  3. 3. Drag to fill: Press Enter, then double-click the fill handle to automatically apply this rule to the entire column.
100% compatibility with Microsoft Excel formulas and .xlsx formatsLightweight software with fast processing for large datasetsBuilt-in syntax guidance and error-checking for complex formulasCompletely free to download and use for your daily tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does my formula return a #VALUE! error instead of N/A?

This usually occurs if one of the cells contains text or spaces rather than being completely blank or containing a valid date. Ensure your date cells are strictly formatted as Dates and clear any hidden space characters from "blank" cells.

Can I leave the cell completely blank instead of displaying 'n/a'?

Yes. To leave the cell blank when a date is missing, replace "n/a" in the formula with two double quotes (""). The formula will look like this: =IF(COUNT(C4:D4)<2,"",D4-C4).

Does this formula work for calculating working days?

Yes, but you need to replace the standard subtraction with the NETWORKDAYS function. The modified formula would be: =IF(COUNT(C4:D4)<2,"n/a",NETWORKDAYS(C4,D4)).