Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula to Calculate Days Past Due Date

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To calculate days past due in Excel, subtract the due date from today's date using =TODAY()-DueDate, then wrap it in IF to show zero or a blank for invoices not yet due: =IF(TODAY()>DueDate,TODAY()-DueDate,0). This gives a live count of overdue days that updates every time the workbook recalculates. You only need a column of due dates and a cell for the formula.

What You'll Need

  • Excel (any modern desktop or Microsoft 365 version; the formulas work in Excel for the web and mobile too).
  • A column containing valid due dates. Dates must be real Excel dates, not text like "15 Jan" typed into a General cell.
  • A destination column for the result, formatted as a number (General or Number, not Date).

Step-by-Step

  1. Set up your due date column. Type dates in a recognised format such as 2025-06-15 or 6/15/2025. If Excel left-aligns them, they may be text. Select the column, go to Data > Text to Columns, click Finish to coerce them into dates, or re-enter them. Right-click the column and choose Format Cells > Date to confirm.
  2. Pick a result cell. In the first empty cell of a new column (say D2, with the due date in C2), type the basic formula: =TODAY()-C2. Press Enter. A positive number means the due date has passed; a negative number means it is still in the future.
  3. Make it show only overdue days. Replace the formula with =IF(TODAY()>C2,TODAY()-C2,0). This returns 0 for anything not yet due, so your totals stay clean. If you prefer a blank instead of zero, use =IF(TODAY()>C2,TODAY()-C2,"").
  4. Calculate against a fixed date instead of today. If you need days past due as of a specific statement date in E1, use =IF($E$1>C2,$E$1-C2,0). The dollar signs lock the reference so you can fill the formula down.
  5. Fill the formula down. Drag the fill handle from D2 to the last row, or double-click it. Check that each row references its own due date (C3, C4, and so on).
  6. Format the result. Select the result column and set Format Cells > Number with 0 decimal places. If the cell shows a date like 1/15/1900, it is still formatted as Date; change it to General or Number.
  7. Add a status label (optional). In E2 use =IF(TODAY()>C2,"Overdue","Current") or a tiered version: =IF(TODAY()>C2+30,"30+ days",IF(TODAY()>C2,"Overdue","Current")). This pairs well with conditional formatting.
  8. Highlight overdue rows. Select the data, go to Home > Conditional Formatting > New Rule > Use a formula, enter =$D2>0, and choose a fill colour. The mixed reference keeps the row highlighted correctly as the formula copies across.
  9. Handle blank due dates. If some rows have no due date, guard the formula: =IF(C2="","",IF(TODAY()>C2,TODAY()-C2,0)). Without this, blank cells are treated as zero and show a huge day count.
  10. Recalculate and verify. Press F9 (or let Excel recalculate automatically) and spot-check two or three rows by hand. Confirm that a due date of today returns 0, yesterday returns 1, and tomorrow returns 0 with the IF wrapper.

Common Mistakes

  • Text dates. A date typed as text produces #VALUE!. Check alignment and use Text to Columns or re-enter the date.
  • Reversed subtraction. =C2-TODAY() gives negative overdue days. Always subtract the due date from today.
  • Result cell formatted as Date. Excel may display 45 as 2/14/1900. Change the format to General or Number.
  • Forgetting the blank guard. Empty due dates become zero and show thousands of days overdue.
  • Hard-coding today's date. Typing a date instead of using TODAY() freezes the count; it will not update tomorrow.
  • Relative references in the fixed-date version. Without $E$1, the reference shifts as you fill down.

Tips

  • Use =DATEDIF(C2,TODAY(),"d") for a clean whole-day difference, though it returns an error if the due date is in the future, so wrap it in IFERROR.
  • Use =NETWORKDAYS(C2,TODAY())-1 to count business days past due, optionally with a holiday range as the third argument.
  • Keep one cell for "as of" date and reference it with absolute addressing so you can run reports for any date.
  • Sort or filter the days-past-due column descending to prioritise the oldest invoices.
  • Name the due date column (Formulas > Define Name) to make formulas easier to read.

Troubleshooting

  • #VALUE! error: the due date cell contains text or a stray space. Clean it with =TRIM(C2) or re-enter the date.
  • All results are negative: you subtracted in the wrong order. Swap to TODAY()-C2.
  • Results do not change: calculation may be set to Manual. Go to Formulas > Calculation Options > Automatic.
  • Numbers show as dates: reformat the result column as Number.
  • Blank rows show huge numbers: add the IF(C2="","",...) guard.
  • Conditional formatting highlights the wrong rows: check the reference style; use =$D2>0 with the column locked and the row relative.

Frequently Asked Questions

Why does my formula return a date instead of a number?

The result cell is formatted as Date. Select it and set Format Cells to General or Number.

How do I count only working days past due?

Use =NETWORKDAYS(C2,TODAY())-1, adding a holiday range as the third argument if needed.

Can I calculate days past due from a fixed date rather than today?

Yes. Put the date in a cell such as E1 and use =IF($E$1>C2,$E$1-C2,0).

Why do blank due dates show thousands of days?

Excel treats an empty cell as zero, which is 1900-01-00. Wrap the formula with IF(C2="","",...).

How do I show "Overdue" instead of a number?

Use =IF(TODAY()>C2,"Overdue","Current") in a separate status column.

Does TODAY() update automatically?

Yes, it recalculates whenever the workbook recalculates or is reopened, as long as calculation is set to Automatic.