DAYS
DAGEN in Dutch Excel
Counts the calendar days from a start date to an end date, returning a negative number when the end comes before the start.
Last updated: 13 October 2026
| Row | A | B | C | D |
|---|---|---|---|---|
| 1 | Entry | Invoice date | Posting date | Days to post |
| 2 | 25-0412 | 18 Dec 2025 | 22 Dec 2025 | 44=DAYS(C2, B2)=DAYS(C2; B2) |
| 3 | 25-0418 | 29 Dec 2025 | 6 Jan 2026 | |
| 4 | 25-0431 | 30 Dec 2025 | 15 Jan 2026 |
Swipe sideways to see all columns
Result: 4
=DAYS(C2,B2)
=DAYS(C2;B2)
What DAYS does and when to use it
What it does: it counts the calendar days from a start date to an end date, for example how many days an invoice has been open.
When to use it: for lead times, days late, invoice age and days to pay. It accepts only valid dates, so bad input shows an error. For working days use NETWORKDAYS.
How Excel evaluates it
Excel reads end_date, then start_date. If both are numbers, it checks that each lies within Excel's date range (serial numbers 1 to 2958465, which is 31 December 9999); a number outside it returns #NUM!. If an argument is text, Excel tries to read it as a date using the regional setting; if that fails, the result is #VALUE!.
Excel then subtracts: end_date - start_date. The result is positive when the end is later, 0 for the same day and negative when the end is earlier.
Watch out: DAYS takes the later date first: DAYS(end_date, start_date). Written in the order the columns appear, every duration comes out negative.
Mental model
A tape measure laid along the calendar, read from the far end back to the start: the far end is named first, and if you lay it the wrong way round the reading comes out negative.
Terms used on this page: serial number, argument, range
DAYS(end_date,start_date)
DAYS(end_date;start_date)
| Argument | Type | Meaning |
|---|---|---|
end_date | Required | The later date. It comes first, unlike most date functions. |
start_date | Required | The earlier date the count starts from. |
Return value:A number: the days from start_date to end_date
Formulas use commas (,) between arguments, as in English Excel. Formulas use semicolons (;) between arguments, as in Dutch Excel. Formulas use commas (,) between arguments, as in English Excel; Dutch Excel uses semicolons (;).
Worked examples
Beginner
Days between invoice date and posting date
You are testing cut-off in the XAF auditfile of Veldhuis Installatie BV. For each entry you want to know how many calendar days passed between the invoice date and the date the entry was posted, so you can pick out purchase invoices from December 2025 that were only booked in the new year.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Entry | Invoice date | Posting date | Days to post | |
| 2 | 25-0412 | 18 Dec 2025 | 22 Dec 2025 | 44=DAYS(C2, B2)=DAYS(C2; B2) | |
| 3 | 25-0418 | 29 Dec 2025 | 6 Jan 2026 | ||
| 4 | 25-0431 | 30 Dec 2025 | 15 Jan 2026 | ||
| 5 |
Swipe sideways to see all columns
Formula in D2
=DAYS(C2,B2)
=DAYS(C2;B2)
Result: 44
Step by step
- Excel reads the first argument, end_date:
C2, the posting date 22 December 2025, serial number 46013. - It reads the second argument, start_date:
B2, the invoice date 18 December 2025, serial number 46009. - Both are valid dates, so Excel subtracts: 46013 - 46009 = 4. Entry
25-0412was posted 4 days after the invoice date. - Copied down,
D3returns 46028 - 46020 = 8 andD4returns 46037 - 46021 = 16. Both of those invoices are dated in 2025 but posted in January 2026, so they belong on your cut-off list.
Watch out: Written as DAYS(B2, C2), in the order the columns appear, D2 shows -4. The size is right and only the sign gives the mistake away.
More on this example: why it works
Why it works
Dates are day counts, so the distance between two dates is a subtraction. DAYS does that subtraction with the later date first, which is why the answer is positive when you name the posting date before the invoice date.
Intermediate
Days late per debtor confirmation
You sent debtor confirmations at year end and are following up on the replies. For each customer you want the days between the reply deadline and the date the reply arrived: positive when the reply was late, negative when it was early.
Customers who have not replied yet should say so instead of showing a meaningless figure. The formula is copied down column D.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Relation | Reply deadline | Reply received | Days late | |
| 2 | D1001 | 23 Jan 2026 | 27 Jan 2026 | 44=IF(C2 = "", "Not received", DAYS(C2, B2))=IF(C2 = ""; "Not received"; DAYS(C2; B2)) | |
| 3 | D1002 | 30 Jan 2026 | 27 Jan 2026 | ||
| 4 | D1003 | 6 Feb 2026 | |||
| 5 | D1004 | 6 Feb 2026 | 6 Feb 2026 | ||
| 6 |
Swipe sideways to see all columns
Formula in D2
=IF(C2 = "","Not received", DAYS(C2, B2))
=IF(C2 = "";"Not received"; DAYS(C2; B2))
Result: 44
Step by step
- Excel evaluates the test first:
C2holds 27 January 2026, so C2 = "" is FALSE and IF moves to its third argument. - DAYS(C2, B2) subtracts the deadline from the reply date: 46049 - 46045 = 4. Customer D1001 replied 4 days after the deadline.
D3: reply on 27 January, deadline 30 January: 46049 - 46052 = -3. The negative number is the information: 3 days early.D4:C4is empty, so the test is TRUE and IF returnsNot received. Without IF, DAYS would read the blank as 0 and return a huge negative number that looks like data.D5: reply on the deadline itself, 46059 - 46059 = 0. On time.
Watch out: Averaging column D with AVERAGE skips the text Not received, which is right, but it also lets early replies cancel out late ones. Report late and early separately if that matters for your follow-up.
More on this example: why it works, 1 variation
Why it works
Putting the reply date first makes a late reply positive and an early one negative, so one column carries both. IF checks for a missing reply before DAYS runs, so the blank never reaches the calculation. No $ signs are needed, because each row reads only its own dates.
Variations
=IF(C2 = "","Not received", C2 - B2)
=IF(C2 = "";"Not received"; C2 - B2)
Plain subtraction gives the same numbers for real dates and works in versions before 2013, but it will not flag a malformed date.
AdvancedExcel 2021 or later (This example needs Excel 2021 or later)
Receivables aging buckets at year end
You reconcile the receivables aging list to the ledger at 31 December 2025. Every open invoice goes into an age band, counted in days since the invoice date and measured at the report date in G1:
0-3031-6061-9091+
The band table sits in I1:J5 so the limits can be changed. An invoice dated after the report date is a cut-off error and must stand out.
| Row | A | B | C | D | E | F | G | H | I | J | K |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Invoice | Invoice date | Open amount | Age bucket | Report date | 31 Dec 2025 | From day | Bucket | |||
| 2 | F-6098 | 15 Oct 2025 | €980.00€ 980,00 | 61-90=XLOOKUP(DAYS($G$1, B2), $I$2:$I$5, $J$2:$J$5, "Check date", -1)=XLOOKUP(DAYS($G$1; B2); $I$2:$I$5; $J$2:$J$5; "Check date"; -1) | 00 | 0-30 | |||||
| 3 | F-6120 | 22 Dec 2025 | €1,450.00€ 1.450,00 | 3131 | 31-60 | ||||||
| 4 | F-6071 | 29 Aug 2025 | €2,300.00€ 2.300,00 | 6161 | 61-90 | ||||||
| 5 | F-6110 | 1 Dec 2025 | €1,100.00€ 1.100,00 | 9191 | 91+ | ||||||
| 6 | F-6085 | 1 Nov 2025 | €750.00€ 750,00 | ||||||||
| 7 | F-6133 | 3 Jan 2026 | €600.00€ 600,00 | ||||||||
| 8 |
Swipe sideways to see all columns
Formula in D2
=XLOOKUP(DAYS($G$1,B2), $I$2:$I$5, $J$2:$J$5, "Check date", -1)
=XLOOKUP(DAYS($G$1;B2); $I$2:$I$5; $J$2:$J$5; "Check date"; -1)
Result: 61-90
Step by step
- Excel evaluates the inner DAYS first: end_date is the report date
$G$1, 31 December 2025 (46022), and start_date isB2, 15 October 2025 (45945). 46022 - 45945 = 77 days. - XLOOKUP looks for 77 in
$I$2:$I$5(0, 31, 61, 91) with match_mode -1: exact, or else the next smaller value. There is no 77, so it takes 61, the third cell,I4. - It returns the third cell of
$J$2:$J$5, which isJ4:61-90. Copied down:
F-6120is 46022 - 46013 = 9 days, bucket0-30F-6071is 124 days,91+F-6110is exactly 30 days, still0-30F-6085is 60 days,31-60
F-6133is dated 3 January 2026, after the report date: 46022 - 46025 = -3. No bucket start is -3 or lower, so XLOOKUP returnsCheck dateinstead of a bucket.
Watch out: If the bucket starts are typed as 0, 30, 60 and 90, an invoice exactly 30 days old lands in 31-60 while its label promises 0-30. Nothing errors; the aging list is quietly off at every boundary and will not agree with the client's own specification.
More on this example: why it works, 1 more pitfall, 1 variation
Why it works
DAYS turns each invoice date into an age measured at one fixed report date, and the negative result for a future date is what makes the cut-off error visible. XLOOKUP with match_mode -1 then finds the highest bucket start that does not exceed the age, so only the bucket starts need to be stored. The $ signs keep the report date and the bucket table fixed while B2 moves down.
More to watch out for
- Using TODAY() instead of
$G$1makes the buckets drift every day after you fix the working paper, so the figures no longer match the ledger at 31 December 2025.
Variations
=XLOOKUP($G$1 - B2,$I$2:$I$5, $J$2:$J$5, "Check date", -1)
=XLOOKUP($G$1 - B2;$I$2:$I$5; $J$2:$J$5; "Check date"; -1)
Subtraction instead of DAYS gives the same buckets for clean dates; DAYS is the safer choice when invoice dates come from an import.
MasterExcel 2021 or later (This example needs Excel 2021 or later)
Amount-weighted days to pay, settled invoices only
You assess how quickly Veldhuis Installatie BV's customer D1001 pays, as input for your view on the allowance for doubtful debts. A plain average treats a small invoice like a large one, so you want the days to pay weighted by amount, over settled invoices only; one invoice is still open.
The formula must handle the blank payment date explicitly and stay readable in the working papers.
| Row | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| 1 | Invoice | Invoice date | Paid on | Amount | Weighted days to pay | 39.0039,00=LET( invoiced, B2:B6, paid, C2:C6, amount, D2:D6, settled, ISNUMBER(paid), days, IF(settled, DAYS(paid, invoiced), 0), weight, amount * settled, SUM(days * weight) / SUM(weight) )=LET( invoiced; B2:B6; paid; C2:C6; amount; D2:D6; settled; ISNUMBER(paid); days; IF(settled; DAYS(paid; invoiced); 0); weight; amount * settled; SUM(days * weight) / SUM(weight) ) | ||
| 2 | F-5401 | 6 Oct 2025 | 10 Nov 2025 | €2,000.00€ 2.000,00 | ||||
| 3 | F-5402 | 14 Oct 2025 | 7 Nov 2025 | €1,000.00€ 1.000,00 | ||||
| 4 | F-5403 | 20 Nov 2025 | €1,500.00€ 1.500,00 | |||||
| 5 | F-5404 | 3 Nov 2025 | 29 Dec 2025 | €3,000.00€ 3.000,00 | ||||
| 6 | F-5405 | 17 Nov 2025 | 12 Dec 2025 | €2,000.00€ 2.000,00 | ||||
| 7 |
Swipe sideways to see all columns
Formula in G1
=LET( invoiced,B2:B6, paid, C2:C6, amount, D2:D6, settled, ISNUMBER(paid), days, IF(settled, DAYS(paid, invoiced), 0), weight, amount * settled, SUM(days * weight) / SUM(weight) )
=LET( invoiced;B2:B6; paid; C2:C6; amount; D2:D6; settled; ISNUMBER(paid); days; IF(settled; DAYS(paid; invoiced); 0); weight; amount * settled; SUM(days * weight) / SUM(weight) )
Result: 39.0039,00
Step by step
- LET names the three columns. settled is ISNUMBER(paid): TRUE, TRUE, FALSE, TRUE, TRUE. The blank payment date of
F-5403is not a number. - days runs DAYS on each row, payment date first: 45971 - 45936 = 35, 45968 - 45944 = 24, 46020 - 45964 = 56, 46003 - 45978 = 25. For
F-5403, IF returns 0 and whatever DAYS made of the blank is discarded. days is 35, 24, 0, 56, 25. - weight multiplies the amounts by settled, where TRUE is 1 and FALSE is 0: 2000, 1000, 0, 3000, 2000. The open invoice no longer counts.
- The numerator: 35 × 2000 + 24 × 1000 + 0 + 56 × 3000 + 25 × 2000 = 70000 + 24000 + 168000 + 50000 = 312000.
- The denominator: 2000 + 1000 + 3000 + 2000 = 8000. The result is 312000 / 8000 = 39 days.
- The unweighted average of the four settled invoices is (35 + 24 + 56 + 25) / 4 = 35. The weighted figure is 4 days higher because the largest invoice, 3000, took the longest, 56 days.
Watch out: The mirror-image mistake is DAYS(invoiced, paid), start first as in NETWORKDAYS. The result is -39; wrapping it in ABS makes it look right but also hides any payment booked before its invoice date, a data error you want to see.
More on this example: why it works, 2 more pitfalls, 1 variation
Why it works
DAYS accepts whole columns and returns one duration per row, so the durations never need a helper column. settled acts twice: inside IF it keeps the blank payment date away from the result, and as a 1/0 multiplier it removes the open invoice from the weights.
Do not use this as a formal DSO figure, which relates the receivables balance to revenue over a period; this measures payment behaviour on settled invoices. When amounts are similar in size, the unweighted average in the variation is the alternative: simpler to explain, but blind to one large invoice paid late.
More to watch out for
- Leaving out the IF and relying on weight alone is not enough: a blank payment date can make DAYS return an error or a huge negative number for that row, and 0 times an error is still an error.
- If no invoice has been paid, SUM(weight) is 0 and the result is #DIV/0!. That is honest; do not hide it with IFERROR.
Variations
=AVERAGE(DAYS(FILTER(C2:C6,ISNUMBER(C2:C6)), FILTER(B2:B6, ISNUMBER(C2:C6))))
=AVERAGE(DAYS(FILTER(C2:C6;ISNUMBER(C2:C6)); FILTER(B2:B6; ISNUMBER(C2:C6))))
The unweighted average of the settled invoices, 35 days: FILTER removes the open row from both columns before DAYS runs.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
| Every duration is negative | Every duration comes out negative. | The arguments were written in start, end order, as in NETWORKDAYS. Swap them. |
| #NUM! on dates from an export | DAYS returns #NUM! on dates from an ERP export, while C2 - B2 on the same cells returns a large number. | The export wrote dates as numbers such as 20260331, far beyond the last valid serial number. DAYS rejects them; subtraction does not. Convert them with DATE(LEFT(...), MID(...), RIGHT(...)) first. |
| A lead time is one day too short | A lead time is one day shorter than the team expects. | DAYS counts the steps between the dates, so Monday to Friday is 4. If both the first and last day count, add 1, or use NETWORKDAYS for working days. |