Skip to content

Excel function · Date & time

Excel DAYS function

DAYS returns the number of days between two dates; the first argument is the end date and the second the start date. Use it for delivery times, days past due and similar counts.

In Turkish Excel: GÜNSAY

What it does

=DAYS(C2,B2) subtracts the date in B2 from the date in C2 and gives the same result as =C2-B2. Mind the order: the end date comes first, then the start; the other way round, the result is negative.

Its advantage over plain subtraction is that it tries to convert text that looks like a date and always returns a number; with subtraction, the result sometimes shows in a date format. Weekends and holidays are counted; for working days only, use NETWORKDAYS.

For completed months or years use DATEDIF; for days up to today, pass TODAY as the end date. For accounting calculations that count every month as 30 days, there is DAYS360.

Syntax

English Excel=DAYS(end_date, start_date)
Turkish Excel=GÜNSAY(bitiş_tarihi; başlangıç_tarihi)

Arguments in square brackets are optional. English Excel separates arguments with commas (,) and uses a dot for decimals; Turkish Excel uses semicolons (;) and a decimal comma. Excel shows function names in its own language when it opens the file.

Arguments

ArgumentRequiredDescription
end_dateRequiredThe date the span ends, the later of the two.
start_dateRequiredThe date the span starts.

Examples

1Days between order and delivery

The formula in D2 is filled down: the delivery date (end) comes first, then the order date (start).

D2fx=DAYS(C2,B2)
Days between order and delivery: example table
ABCD
1OrderOrder DateDelivery DateDelivery Time (Days)
2SO-8011-Oct-20266-Oct-20265
3SO-8023-Oct-202617-Oct-202614
4SO-80328-Oct-20264-Nov-20267
5SO-80430-Oct-202631-Oct-20261
  • D2 (filled down to D5)=DAYS(C2,B2)

SO-802 took 14 days to deliver. The count stays correct across months: SO-803 gives 7. SO-804, delivered the next day, shows 1.

We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.

2Days overdue as of a report date

The report date is in F2. DAYS subtracts the due date from the report date; MAX turns the negative result for invoices not yet due into 0.

D2fx=MAX(0,DAYS($F$2,B2))
Days overdue as of a report date: example table
ABCDEF
1InvoiceDue DateAmountDays OverdueReport Date
2F-204120-Oct-202612,400.00165-Nov-2026
3F-204312-Nov-20267,200.000
4F-204531-Oct-20262,600.005
5F-20475-Nov-20265,300.000
  • D2 (filled down to D5)=MAX(0,DAYS($F$2,B2))

F-2041 is 16 days past due. For F-2043, which is not yet due, DAYS returns a negative number and MAX turns it into 0. Change the date in F2 to see the delays as of another day.

We recalculated this example in real Excel (Microsoft 365, 16.0) and compared the results: they match.

Common errors and fixes

Negative result

Cause: The arguments were written the wrong way round: start first, then end.

Fix: Put the end date first: =DAYS(C2,B2); or take the absolute value of the result (ABS).

#VALUE!

Cause: One of the dates is text that cannot be converted to a date.

Fix: Enter the dates as real dates or build them with DATE.

Good to know

  • To count both the first and the last day, add 1: =DAYS(C2,B2)+1; 1 to 5 November is 5 days.
  • To show 0 for invoices that are not yet due: =MAX(0,DAYS($F$2,B2)) (MAX).

In Nexell

Get Nexell to do it from a sentence

Type this in Nexell

Add a Delivery Time column to the order list showing the number of days between the order date and the delivery date

Convert to table

Bring your order list into the tool and type this. Nexell adds the Delivery Time column with real Excel formulas and shows it in the preview; in the downloaded file, the time changes when a date does.

Nexell uses AI to understand the request and builds the result with real Excel formulas; the formula may differ from the example on this page. You see a preview first and nothing changes until you press Apply; formulas stay live in the downloaded .xlsx file.

Free account · no card needed · 30 credits a month

Frequently asked questions

How do I count the days between two dates in Excel?

Subtract the earlier date from the later one: =C2-B2 or =DAYS(C2,B2). To leave out weekends, use =NETWORKDAYS(B2,C2); that function counts the start and end days too.

Related functions

All date & time functions →

Stop memorising formulas. Describe them.

Bring your table into the tool and say what you need; Nexell builds the formula and shows it in a preview.

Try it free