Date formula page

Days Until Due Date Formula

Use this when a task, invoice, or project row has one due date and you want days remaining.

Best for

Calculate days until a due date.

What it returns

If A2 is a future due date, the formula returns the remaining calendar days.

Copy formulas

Excel formula
=IF(A2="", "", A2-TODAY())
Google Sheets formula
=IF(A2="", "", A2-TODAY())
Excel / Google Sheets difference

Excel and Google Sheets use the same formula syntax for this pattern.

Example data

TaskOwnerStatusDue DateHours
Import leadsMayaComplete2026-01-063
Clean headersNicoIn Progress2026-01-082
Review budgetMayaComplete2026-01-124
Publish reportIrisBlocked2026-01-151

Formula explanation

  • The blank guard keeps empty due dates from showing a number.
  • A2 minus TODAY returns remaining days.
  • Negative results mean the item is overdue.

What this formula does

Days Until Due Date Formula is built around IF. The example formula on this page is =IF(A2="", "", A2-TODAY()), and it is written against sample columns such as Task, Owner, Status, Due Date, Hours.

Excel and Google Sheets use the same copy pattern here, so the main work is adjusting ranges, criteria, and output cells to match your sheet.

Date formulas work because spreadsheet dates are stored as serial values. The visible date format can change, but the underlying value must still be a real date for the formula to be reliable.

Use this pattern for this task: Calculate days until a due date. If the result looks like a number, format the output cell as a date or number according to the result you expect.

Syntax pieceRole in the formula
Part 1The blank guard keeps empty due dates from showing a number.
A2A2 minus TODAY returns remaining days.
Part 3Negative results mean the item is overdue.

Practical use cases

Excel copy output
=IF(A2="", "", A2-TODAY())

Excel: Use this in a timeline, invoice, or task tracker where real date cells control the result. Returns: If A2 is a future due date, the formula returns the remaining calendar days.

Google Sheets copy output
=IF(A2="", "", A2-TODAY())

Google Sheets: Use this when a report needs a repeatable date calculation that can be filled down row by row. Returns: If A2 is a future due date, the formula returns the remaining calendar days.

Common errors

  • Cells that only look like dates may actually be text.
  • Inclusive date counts require adding 1 when both start and end dates should count.
  • Date formulas can return decimals when source cells contain times.

Common errors and troubleshooting

IssueLikely causeFix
Copied formula gives an unexpected resultCells that only look like dates may actually be text.Format source cells as dates, remove text dates, and decide whether endpoints should be inclusive or exclusive.
Common setup problemInclusive date counts require adding 1 when both start and end dates should count.Format source cells as dates, remove text dates, and decide whether endpoints should be inclusive or exclusive.
Common setup problemDate formulas can return decimals when source cells contain times.Format source cells as dates, remove text dates, and decide whether endpoints should be inclusive or exclusive.
Result shows a serial numberThe formula returned a valid date value, but the output cell is formatted as a number.Change the output format to Date, or keep the number format when the expected answer is an elapsed day count.
Date calculation is off by one dayThe business rule may count both endpoints, or the source cells may contain time values.Add 1 only for inclusive elapsed days, and remove times or use explicit boundaries when comparing dates.

When not to use this formula

  • Do not use simple date subtraction for business days; use NETWORKDAYS or WORKDAY.
  • Do not use DATEDIF for rounded month math; it returns completed periods.

Alternatives

AlternativeWhen to use it
Date Difference Formula BuilderUse for days, completed months, or completed years.
Excel Date Serial ConverterUse when imported dates arrive as serial numbers.
FILTER Rows by DateUse when the goal is returning rows by date instead of calculating one value.

Compare with related formulas

Formula or toolHow it differsUse it instead when
Date Difference Formula BuilderDate Difference Formula Builder solves a nearby workflow, while Days Until Due Date Formula is focused on calculate days until a due date.Use for days, completed months, or completed years.
Excel Date Serial ConverterExcel Date Serial Converter solves a nearby workflow, while Days Until Due Date Formula is focused on calculate days until a due date.Use when imported dates arrive as serial numbers.
FILTER Rows by DateFILTER Rows by Date solves a nearby workflow, while Days Until Due Date Formula is focused on calculate days until a due date.Use when the goal is returning rows by date instead of calculating one value.

Test cases

TestPlatformFormulaReturns
Excel copy outputExcel=IF(A2="", "", A2-TODAY())If A2 is a future due date, the formula returns the remaining calendar days.
Google Sheets copy outputGoogle Sheets=IF(A2="", "", A2-TODAY())If A2 is a future due date, the formula returns the remaining calendar days.

Related formulas

FAQ

What does the Days Until Due Date Formula do?

It supports this task: Calculate days until a due date. The example uses A2, but you should replace the ranges and criteria with the cells in your own workbook.

Does the Days Until Due Date Formula work in Excel and Google Sheets?

Yes. The Excel and Google Sheets versions on this page use the same syntax for this pattern.

What should I change before copying the formula?

Change the source ranges, criteria cells, and output range references so they match your sheet. Keep related ranges on the same rows unless the formula notes say otherwise.

Why does my date formula show a number?

The result is probably a valid spreadsheet date serial. Format the output cell as Date when the answer should display as a date.

Does this count both the start and end date?

It depends on the formula. Functions like NETWORKDAYS count both the start and end dates by default, while a plain end-minus-start subtraction does not. Add 1 only when your rule should count both endpoints, and check the expected result section for this formula.

What if my date is stored as text?

Convert text dates to real spreadsheet dates before relying on date math. Text that only looks like a date can produce wrong results.