logo
search
Calculation Issues

How to Calculate Days from a Date to Today Ignoring Blank Cells in Excel

Maira MehtabMaira Mehtab Sep 22, 2026 869 views

Question details

The user wants to calculate the number of days elapsed between a specified past date and today, while leaving the result blank if the source date cell is empty.

Product
Excel
Device & OS
not provided
Scenario
Tracking durations, project timelines, or aging items based on a start date up to the current date.
Observed behavior
Using standard subtraction (TODAY() - A2) results in a massive day count (often over 40,000) when the source date cell is empty, because the system treats the blank cell as a zero-value date.
Before you start

Ensure your source cells are formatted as Dates and that your computer's system clock is accurate, as the TODAY() function relies on your device's current date setting.

Solution 1Recommended

Use the IF Function with TODAY() to Handle Blank Cells

Wrap your date calculation in an IF function to check if the cell is empty before performing the math, preventing the default 1900 date subtraction issue.

When Excel performs math on a blank cell, it treats the blank as a zero. In Excel's date system, zero represents January 0, 1900. Subtracting this base date from today's date yields a very large number. By explicitly telling Excel to return a blank string if the cell is empty, you can keep your spreadsheets clean and accurate.

1
Select the target cell

Click on the cell where you want the calculated days count to appear (for example, cell B2).

2
Enter the IF formula

Type the formula `=IF(A2="","",TODAY()-A2)` into the formula bar and press Enter. Be sure to replace 'A2' with your actual source date cell.

3
Format the result as a number

Right-click the result cell, select 'Format Cells', and choose 'General' or 'Number' to ensure the result displays as a quantity of days rather than a formatted date.

4
Apply to the entire column

Click and drag the fill handle (the small square at the bottom-right of the selected cell) down your column to copy the formula to the remaining rows.

Pro Tip: If your dataset contains future dates and you want to prevent negative numbers from appearing, you can use the MAX function like this: =IF(A2="","",MAX(0,TODAY()-A2)).
Efficient Spreadsheet Calculation

Easily Calculate Dates and Handle Blank Cells in WPS Spreadsheet

WPS Spreadsheet fully supports Excel's TODAY and IF functions, allowing you to seamlessly calculate elapsed days, track project deadlines, and manage aging reports without formatting errors.

  1. 1. Open your file in WPS: Launch WPS Spreadsheet and open the document containing your list of dates.
  2. 2. Apply the conditional formula: Select your target cell and enter `=IF(A2="","",TODAY()-A2)` to perform the calculation.
  3. 3. Adjust formatting: Use the Home tab ribbon to quickly format the cell as a Number, then drag the fill handle down to apply it across your entire dataset.
Fully compatible with Microsoft Excel formulas, functions, and date formats.Lightweight and fast, ideal for processing large tracking datasets.Clean and familiar user interface for smooth and efficient data management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does TODAY()-A2 return a date instead of a number?

Excel sometimes auto-formats the result cell as a Date because the formula contains date components. You can easily fix this by changing the cell format from 'Date' to 'General' or 'Number' in the Home tab.

Can I calculate the days between two specific dates instead of today?

Yes. Simply replace the TODAY() function in the formula with your end date cell reference. For example, if your end date is in B2 and start date is in A2, use `=IF(A2="","",B2-A2)`.

What if the cell contains a space instead of being truly blank?

If the source cell has a hidden space character, `A2=""` will not recognize it as blank, resulting in a #VALUE! error. You can use the TRIM function inside the condition, like `=IF(TRIM(A2)="","",TODAY()-A2)`, to safely handle spaces.