Dates and times as serial numbers
Excel stores a date as a count of days and a time as a fraction of a day, so you can subtract, add and compare them. Learn how to count days, repair text dates and add up hours.
Last updated: 14 October 2026
Explains: serial number
Behind every date in a workbook is a number: 31 Dec 2025 is 46022, and 12:00 is 0.5. That explains:
- why you can subtract two dates
- why a column of dates from an export sometimes refuses to sort or calculate
- why a total of hours can show 18:30 instead of 42:30
For an auditor it matters in cut-off tests, aging lists, payment terms and time registrations, where one wrong date or one date stored as text changes a conclusion.
A date is a number
Excel stores every date as a whole number: the number of days since 1 January 1900, which is serial 1. So 1 Jan 2025 is 45658 and 31 Dec 2025 is 46022.
What you see as 31-12-2025 is the number 46022 shown through a date format. The number is the value; the format only decides the display.
Because a date is a number, everything you do with numbers works on dates:
- subtract two dates to get days
- add 7 to get the same weekday next week
- compare with
<and> - sort, and take the smallest, largest or average
That is also why a criterion such as "<"&F2 can compare dates in SUMIFS and COUNTIFS.
| Number | Shown as | Meaning |
|---|---|---|
1 | 1 Jan 1900 | The first day Excel counts |
45658 | 1 Jan 2025 | The first day of the 2025 financial year |
46022 | 31 Dec 2025 | The balance sheet date of the audit |
46023 | 1 Jan 2026 | One day later: add 1 |
| 46022.75 | 31 Dec 2025 18:00 | The whole part is the day, the fraction is the time |
| 0.5 | 12:00 | Half a day: noon |
A time is a fraction of a day
The part after the decimal point is the time of day. One whole day is 1, so:
- 12:00 is 0.5
- 06:00 is 0.25
- one hour is 1/24 (0.041667)
- one minute is 1/1440 (0.000694)
A cell can hold a date and a time together: 46022.75 is 31 Dec 2025 at 18:00. A cell with only a time has no whole part.
To turn a time difference into hours, multiply by 24 (by 1440 for minutes). When a shift ends after midnight, the end time is smaller than the start time and the plain subtraction is negative. MOD(end-start, 1) adds the missing day.
To show totals above 24 hours, use the number format [h]:mm; with plain h:mm Excel starts again after 24 hours, so 30 hours shows as 06:00.
=(C2-B2)*24
=(C2-B2)*24
Hours between a start time in B2 and an end time in C2 on the same day.
=MOD(C2-B2,1)*24
=MOD(C2-B2;1)*24
Hours for a shift that may cross midnight: the missing day is added when the difference is negative.
=A2+1/24
=A2+1/24
One hour later than the date and time in A2.
Calculating with dates
Most date work is arithmetic on numbers. The result of subtracting two dates is a number of days, and Excel often gives that cell a date format because the inputs had one: change the format to General or Number, otherwise 35 days shows as 04-02-1900. Subtracting does not count the start day, so 1 Dec to 8 Dec is 7 days.
For calendar logic use the date functions: they know about weekends, month lengths and leap years. NETWORKDAYS counts both the start day and the end day and skips Saturdays, Sundays and an optional list of holidays. EDATE keeps the day of the month where it can: 31 Jan 2026 plus one month is 28 Feb 2026, the last day that exists.
| Task | Use | Remark |
|---|---|---|
| Days between two dates | C2-B2 | End date minus start date. Format the cell as General. |
| The same, reading left to right | DAYS | The end date comes first: DAYS(C2, B2). The result equals C2-B2. |
| A week or 30 days later | B2+7 | Adding a number moves the date by that many days. |
| Working days between two dates | NETWORKDAYS | Counts the start and end day. A third argument takes a list of holidays. |
| The date 10 working days later | WORKDAY | Skips weekends and an optional holiday list. |
| The same day, months later | EDATE | Stops at the last day of a shorter month. |
| The end of a month | EOMONTH | A months argument of 0 gives the end of the month of the date itself. |
| Today's date | TODAY | Recalculates every time the workbook calculates, so a saved aging list changes by itself. |
=C2-B2
=C2-B2
Days from the invoice date in B2 to the payment date in C2.
=NETWORKDAYS(B2,C2, F2:F12)
=NETWORKDAYS(B2;C2; F2:F12)
Working days from B2 to C2 inclusive, without the holidays listed in F2:F12.
=EOMONTH(B2,0)
=EOMONTH(B2;0)
The last day of the month of B2, a usual date for cut-off tests.
=EDATE(B2,3)
=EDATE(B2;3)
The same day three months later, for example a quarterly due date.
Formatting changes only the display
Press Ctrl+1 to change how a number is shown. The same cell can display 46022, 31-12-2025, 31 Dec 2025 or Wednesday; the value behind it stays 46022 and every formula keeps using that value. A number shown as a date or the other way round is therefore a formatting question, not a calculation error.
TEXT is different: it returns text. =TEXT(B2, "dd-mm-yyyy") looks like a date but cannot be subtracted or sorted as a date any more.
Format codes are localized: Dutch Excel writes the year as jjjj, English Excel as yyyy, so the same code can fail in the other version. Use TEXT only for the last step, such as a label in a report.
=TEXT(B2,"dd-mm-yyyy")
=TEXT(B2;"dd-mm-yyyy")
The date in B2 as text with the day first; the format code is dd-mm-jjjj in Dutch Excel.
=B2
=B2
The same value with another number format: format the cell as General and it shows 46022.
Dates stored as text
Watch out: The order of day and month is the risky case: 03-12-2025 is 3 December in a Dutch regional setting but 12 March in a US setting, and 29-12-2025 cannot be read as month-day at all, so it stays text.
Exports from accounting packages, banks and PDF conversions often hold dates as text that only looks like a date. Excel cannot calculate with it. The signs:
- the value is left-aligned
- ISNUMBER returns FALSE
- a sort puts
02-01-2026before29-12-2025 - subtraction gives #VALUE! or a wrong answer
A file in which some dates convert and others do not has usually met the wrong regional setting. DATEVALUE follows your regional setting, so it is only safe when the text uses the same order. DATE with LEFT, MID and RIGHT takes the parts apart yourself and gives the same result in every setting.
For a whole column, Data > Text to Columns converts in place:
- choose Delimited
- press Next twice
- set the column data format to Date and pick the order, for instance DMY
Remove stray spaces first with TRIM; a non-breaking space from a web export needs SUBSTITUTE.
| What you see | What it means | Fix |
|---|---|---|
| The date sits against the left edge | Text, not a number | Convert with DATE, DATEVALUE or Text to Columns |
ISNUMBER | FALSE for the cell confirms text | Test a whole column with a count of the TRUE results |
| Some dates convert, dates with a day above 12 do not | The file was read with day and month swapped | Re-import as text, then split with LEFT, MID and RIGHT |
| The cell shows 46022 or ######## | A real number with the wrong format, a negative date, or the column is too narrow | Change the format; widen the column; check the order of the subtraction |
=ISNUMBER(B2)
=ISNUMBER(B2)
TRUE for a real date, FALSE for text that looks like one.
=DATE(RIGHT(B2,4), MID(B2, 4, 2), LEFT(B2, 2))
=DATE(RIGHT(B2;4); MID(B2; 4; 2); LEFT(B2; 2))
Converts day-month-year text such as 03-12-2025 to 3 Dec 2025 in every regional setting.
=DATE(LEFT(B2,4), MID(B2, 6, 2), RIGHT(B2, 2))
=DATE(LEFT(B2;4); MID(B2; 6; 2); RIGHT(B2; 2))
Converts year-month-day text such as 2025-12-03 in the same way.
=DATEVALUE(B2)
=DATEVALUE(B2)
Converts text in the order of your own regional setting; test one row with a day above 12 first.
Useful date functions
These functions cover most of what an auditor needs. The ones with a page on this site link to it. Dutch Excel uses the Dutch names and semicolons between arguments; the formulas in the examples on this page are shown in your language.
| Function | What it does |
|---|---|
TODAY | Today's date; recalculates, so it is volatile. |
NOW | Today's date and the current time. |
DATE | Builds a date from a year, month and day; DATE(2025, 12, 31) is 46022. |
YEAR | The year of a date. |
MONTH | The month number of a date, 1 to 12. |
DAY | The day of the month, 1 to 31. |
WEEKDAY | The day of the week as a number; by default Sunday is 1 and Saturday is 7, so 31 Dec 2025 (a Wednesday) gives 4. A second argument of 2 makes Monday 1. |
DAYS | The number of days between two dates, end date first. |
EDATE | The same day of the month, a number of months away. |
EOMONTH | The last day of the month, a number of months away. |
NETWORKDAYS | Working days between two dates, both days included, without weekends and holidays. |
WORKDAY | The date a number of working days after a start date. |
DATEVALUE | Converts a date written as text to a serial number, using your regional setting. |
Limits and quirks
Excel counts 29 Feb 1900 (serial 60) as a real day, although 1900 was not a leap year. The error was copied from Lotus 1-2-3 and kept for compatibility. It has no effect on dates from 1 Mar 1900 onward, which is all audit data, but any date before that is one day off and WEEKDAY is wrong for it.
Excel cannot hold dates before 1 Jan 1900, and a negative date shows as ########.
Some older Mac workbooks use the 1904 date system, which shifts every date by 1462 days; check File > Options > Advanced when dates from a received file look four years off.
Times are stored as binary fractions, so a time calculated by adding fractions can differ from the typed time in the last digits. Then =B2=C2 returns FALSE although both cells show 08:30. Round both to the precision you need before comparing, for instance to whole minutes with ROUND(B2*1440, 0).
Also remember that a date with a time is not equal to the date alone: 31 Dec 2025 14:30 is about 46022.604, so INT removes the time when you need the day.
=ROUND(B2*1440,0)=ROUND(C2*1440, 0)
=ROUND(B2*1440;0)=ROUND(C2*1440; 0)
Compares two times to the nearest minute, ignoring binary rounding noise.
=INT(A2)
=INT(A2)
The date part of a date with a time.
Worked examples
Example1 of 4Beginner
Average days from invoice to payment
In the receivables of Veldhuis Installatie BV you look at the five largest sales invoices of Q4 2025 and the dates the bank received the payments. You want the average number of days customers took to pay, to compare with the 30 day payment term on the invoices.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Invoice no. | Customer | Invoice date | Payment date | Average days to pay | ||
| 2 | V-25-0731 | D1003 | 6 Oct 2025 | 7 Nov 2025 | 3535=AVERAGE(D2:D6) - AVERAGE(C2:C6)=AVERAGE(D2:D6) - AVERAGE(C2:C6) | ||
| 3 | V-25-0748 | D1008 | 20 Oct 2025 | 28 Nov 2025 | |||
| 4 | V-25-0766 | D1003 | 3 Nov 2025 | 12 Dec 2025 | |||
| 5 | V-25-0790 | D1014 | 17 Nov 2025 | 22 Dec 2025 | |||
| 6 | V-25-0805 | D1008 | 1 Dec 2025 | 31 Dec 2025 | |||
| 7 |
Swipe sideways to see all columns
Formula in F2
=AVERAGE(D2:D6) - AVERAGE(C2:C6)
=AVERAGE(D2:D6) - AVERAGE(C2:C6)
Result: 3535
Step by step
- Behind the dates are serial numbers. The invoice dates in
C2:C6are 45936, 45950, 45964, 45978 and 45992. The payment dates inD2:D6are 45968, 45989, 46003, 46013 and 46022. - AVERAGE of the invoice dates: (45936 + 45950 + 45964 + 45978 + 45992) / 5 = 229820 / 5 = 45964. That serial number is 3 Nov 2025, the average invoice date.
- AVERAGE of the payment dates: (45968 + 45989 + 46003 + 46013 + 46022) / 5 = 229995 / 5 = 45999, which is 8 Dec 2025.
- Subtract: 45999 - 45964 = 35. Both dates are numbers, so the difference is a number of days, not a date.
- Customers took 35 days on average, 5 days longer than the 30 day term. Per invoice the days are 32, 39, 39, 35 and 30, which add up to 175; 175 / 5 = 35 as well.
- If Excel shows 04-02-1900 in
F2, the cell took a date format from the inputs. Change the format to General and the value 35 appears.
Watch out: The average hides the spread. One invoice paid after 5 days offsets another paid after 65 and the average still looks acceptable. Look at the largest single difference as well before you conclude on the payment behavior of customers.
More on this example: why it works, 2 variations
Why it works
AVERAGE works on dates because it works on their serial numbers. The difference of two averages equals the average of the differences, so you get the average payment time without a helper column with D2-C2 for every row.
Variations
=D2-C2
=D2-C2
The days for the first invoice only: 45968 - 45936 = 32.
=DAYS(D6,C6)
=DAYS(D6;C6)
The days for the last invoice, end date first: 46022 - 45992 = 30.
Example2 of 4Intermediate
Entries posted after year end in a text date export
The bookkeeper of Veldhuis Installatie BV sends the last purchase entries as an export in which the posting date is text in the order day-month-year. For the cut-off test you want the total of the entries posted after 31 Dec 2025, without first converting the column by hand.
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Entry no. | Posting date (text) | Amount | Cut-off date | ||
| 2 | 25-1215 | 29-12-2025 | €4,850.00€ 4.850,00 | 31 Dec 2025 | ||
| 3 | 25-1216 | 03-01-2026 | €6,200.00€ 6.200,00 | Posted after | ||
| 4 | 25-1217 | 31-12-2025 | €9,400.00€ 9.400,00 | €9,290.00€ 9.290,00=SUMPRODUCT((DATE(RIGHT(B2:B7, 4), MID(B2:B7, 4, 2), LEFT(B2:B7, 2)) > E2) * C2:C7)=SUMPRODUCT((DATE(RIGHT(B2:B7; 4); MID(B2:B7; 4; 2); LEFT(B2:B7; 2)) > E2) * C2:C7) | ||
| 5 | 25-1218 | 02-01-2026 | €2,310.00€ 2.310,00 | |||
| 6 | 25-1219 | 30-12-2025 | €1,260.00€ 1.260,00 | |||
| 7 | 25-1220 | 05-01-2026 | €780.00€ 780,00 | |||
| 8 |
Swipe sideways to see all columns
Formula in E4
=SUMPRODUCT((DATE(RIGHT(B2:B7,4), MID(B2:B7, 4, 2), LEFT(B2:B7, 2)) > E2) * C2:C7)
=SUMPRODUCT((DATE(RIGHT(B2:B7;4); MID(B2:B7; 4; 2); LEFT(B2:B7; 2)) > E2) * C2:C7)
Result: €9,290.00€ 9.290,00
Step by step
- The text in
B2:B7is day-month-year with a fixed layout: the day is the first 2 characters, the month the 2 after the first hyphen, the year the last 4. LEFT, MID and RIGHT cut those parts out and DATE turns them into real dates, in any regional setting. The six texts become:
- 29 Dec 2025 (46020)
- 3 Jan 2026 (46025)
- 31 Dec 2025 (46022)
- 2 Jan 2026 (46024)
- 30 Dec 2025 (46021)
- 5 Jan 2026 (46027)
The row
25-1216is the text03-01-2026: day 3, month 1, so 3 Jan 2026, not 1 Mar 2026.E2holds 31 Dec 2025, serial 46022. The comparison >E2gives TRUE for 46025, 46024 and 46027 and FALSE for 46020, 46022 and 46021. The entry on 31 Dec itself is not after the cut-off date.- TRUE and FALSE become 1 and 0 when multiplied by the amounts in
C2:C7: 0 x 4850, 1 x 6200, 0 x 9400, 1 x 2310, 0 x 1260 and 1 x 780. - SUMPRODUCT adds the six products: 6200 + 2310 + 780 = 9290. These three entries are dated in 2026 and need a check on whether the goods or services were received before year end.
- With DATEVALUE in a US regional setting the same column would break: 29-12-2025, 30-12-2025 and 31-12-2025 have no month 29, 30 or 31 and return #VALUE!, and 02-01-2026 would be read as 1 Feb 2026.
Watch out: The formula needs exactly 10 characters, dd-mm-yyyy. A text such as 3-1-2026 or one with a leading space shifts the positions and gives wrong dates without an error. Check LEN of the column, and use TRIM first when needed.
More on this example: why it works, 1 variation
Why it works
A text cannot be compared with a date, so the text is first rebuilt as a date from its fixed positions. DATE does not depend on the regional setting, and inside SUMPRODUCT the formula calculates all six rows as an array, so no helper column is needed.
Variations
=SUMPRODUCT(--(DATE(RIGHT(B2:B7,4), MID(B2:B7, 4, 2), LEFT(B2:B7, 2)) > E2))
=SUMPRODUCT(--(DATE(RIGHT(B2:B7;4); MID(B2:B7; 4; 2); LEFT(B2:B7; 2)) > E2))
Counts the entries after the cut-off date instead of adding them up: 3.
Example3 of 4Advanced
Hours worked on night shifts across midnight
For the payroll test at Veldhuis Installatie BV you recalculate the hours of one warehouse employee for the week of 15 to 19 Dec 2025 from the time registration. Three shifts start in the evening and end the next morning. The payroll summary pays 44 hours, and you want to see what the registration supports.
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Shift date | Start | End | Hours worked | ||
| 2 | 15 Dec 2025 | 22:00 | 06:00 | 42.5042,50=ROUND(SUMPRODUCT((C2:C6 < B2:B6) + C2:C6 - B2:B6) * 24, 2)=ROUND(SUMPRODUCT((C2:C6 < B2:B6) + C2:C6 - B2:B6) * 24; 2) | ||
| 3 | 16 Dec 2025 | 21:30 | 05:45 | |||
| 4 | 17 Dec 2025 | 08:00 | 16:30 | |||
| 5 | 18 Dec 2025 | 22:15 | 06:15 | |||
| 6 | 19 Dec 2025 | 14:00 | 23:45 | |||
| 7 |
Swipe sideways to see all columns
Formula in E2
=ROUND(SUMPRODUCT((C2:C6 < B2:B6) + C2:C6 - B2:B6) * 24,2)
=ROUND(SUMPRODUCT((C2:C6 < B2:B6) + C2:C6 - B2:B6) * 24;2)
Result: 42.5042,50
Step by step
- A time is a fraction of a day: 22:00 is 22/24 = 0.9167 and 06:00 is 6/24 = 0.25. The shift of 15 Dec ends after midnight, so C2 - B2 = 0.25 - 0.9167 = -0.6667, a negative number.
The test C2 < B2 asks whether the end is earlier than the start, which means the shift crossed midnight.
Here it is TRUE, which counts as 1, so one whole day is added: -0.6667 + 1 = 0.3333, which is 8 hours. When the end is later, the test is FALSE (0) and nothing is added.
The other differences, in hours:
- 21:30 to 05:45 is 8.25 (fraction 0.3438 after adding the day)
- 08:00 to 16:30 is 8.5 (0.3542, no day needed)
- 22:15 to 06:15 is 8 (0.3333)
- 14:00 to 23:45 is 9.75 (0.4063)
- SUMPRODUCT adds the five fractions: 0.3333 + 0.3438 + 0.3542 + 0.3333 + 0.4063 = about 1.7708 days. Multiplying by 24 converts days to hours: about 1.7708 x 24 = 42.5.
- ROUND to 2 decimals removes any binary rounding noise from the multiplication, so the cell holds 42.5. The registration supports 42.5 hours against 44 paid: a difference of 1.5 hours to ask the payroll administration about.
Watch out: A shift of exactly 24 hours (start and end equal) gives 0 here, not 24. If such shifts exist, record the end as a date with a time and subtract the full values.
More on this example: why it works, 1 variation
Why it works
Adding one day whenever the end is earlier than the start turns every difference into a fraction of a day between 0 and 1, so a shift that crosses midnight and one that does not are handled by the same formula. MOD(end - start, 1) does the same in one function. As long as no shift lasts 24 hours or longer, the result is correct.
Variations
=MOD(C2 - B2,1)
=MOD(C2 - B2;1)
The first shift with MOD, as a time difference. Format the cell as [h]:mm to see 8:00; use the brackets for a weekly total, which would otherwise restart after 24 hours.
Example4 of 4Master
Receivables more than 60 days overdue at the report date
The aging list of Veldhuis Installatie BV at 31 Dec 2025 shows the due date and the open amount per invoice. You want the amount that is more than 60 days past due, as the base for the assessment of the bad debt allowance. The report date sits in a cell so the same formula works for another date.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Invoice no. | Customer | Due date | Open amount | Report date | ||
| 2 | V-25-0640 | D1004 | 15 Sep 2025 | €3,200.00€ 3.200,00 | 31 Dec 2025 | ||
| 3 | V-25-0702 | D1011 | 14 Oct 2025 | €1,845.50€ 1.845,50 | Over 60 days past due | ||
| 4 | V-25-0734 | D1007 | 31 Oct 2025 | €12,400.00€ 12.400,00 | €17,445.50€ 17.445,50=SUMIFS(D2:D8, C2:C8, "<" & (F2 - 60))=SUMIFS(D2:D8; C2:C8; "<" & (F2 - 60)) | ||
| 5 | V-25-0751 | D1002 | 1 Nov 2025 | €5,750.00€ 5.750,00 | |||
| 6 | V-25-0787 | D1015 | 28 Nov 2025 | €2,960.00€ 2.960,00 | |||
| 7 | V-25-0812 | D1009 | 19 Dec 2025 | €8,115.75€ 8.115,75 | |||
| 8 | V-25-0830 | D1004 | 9 Jan 2026 | €4,300.00€ 4.300,00 | |||
| 9 |
Swipe sideways to see all columns
Formula in F4
=SUMIFS(D2:D8,C2:C8, "<" & (F2 - 60))
=SUMIFS(D2:D8;C2:C8; "<" & (F2 - 60))
Result: €17,445.50€ 17.445,50
Step by step
F2holds 31 Dec 2025, serial 46022. An invoice is more than 60 days past due when report date minus due date is greater than 60, which is the same as due date smaller than report date minus 60.F2- 60 = 46022 - 60 = 45962, which is 1 Nov 2025. The&joins the text<and the number 45962 into the criterion<45962, which SUMIFS compares with the serial numbers inC2:C8.The due dates as serials:
- 45915 (15 Sep)
- 45944 (14 Oct)
- 45961 (31 Oct)
- 45962 (1 Nov)
- 45989 (28 Nov)
- 46010 (19 Dec)
- 46031 (9 Jan 2026)
- Smaller than 45962: 45915, 45944 and 45961, so the invoices of
D1004(3,200.003.200,00),D1011(1,845.501.845,50) andD1007(12,400.0012.400,00). The invoice due on 1 Nov is exactly 60 days overdue (46022 - 45962) and does not count: not more than 60. - SUMIFS adds
D2,D3andD4: 3200 + 1845.50 + 12400 = 17445.50. - Change
F2to 30 Nov 2025 and the limit becomes 45991 - 60 = 45931 (1 Oct 2025): only the invoice due on 15 Sep stays, 3,200.003.200,00. The formula recalculates because the date is a number.
Watch out: Typing the limit as text, "<31-12-2025", depends on the regional setting and can be read as month-day. Build the limit from a date cell as in this formula, and put the parentheses around F2 - 60 so the reader sees that the calculation comes first.
More on this example: why it works, 2 variations
Why it works
In a SUMIFS criterion a comparison operator and a number are joined as text, and SUMIFS reads the number back as a serial number. Because the limit is calculated from the report date, there is no hard-coded date in the formula, which keeps the aging list reusable and the 60 days visible.
Variations
=SUMIFS(D2:D8,C2:C8, "<" & (F2 - 90))
=SUMIFS(D2:D8;C2:C8; "<" & (F2 - 90))
More than 90 days past due: the limit is 45932 (2 Oct 2025) and only the invoice due on 15 Sep counts, 3,200.003.200,00.
=SUMIFS(D2:D8,C2:C8, ">=" & (F2 - 60), C2:C8, "<=" & F2)
=SUMIFS(D2:D8;C2:C8; ">=" & (F2 - 60); C2:C8; "<=" & F2)
Due in the 60 days up to the report date: 5,750.005.750,00 + 2,960.002.960,00 + 8,115.758.115,75 = 16,825.7516.825,75.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
| A date shows where you expected a number of days | The cell with =C2-B2 shows 04-02-1900 instead of 35. | Excel copied the date format from the inputs, and 35 is the date 4 Feb 1900. The value is right; set the cell to General. |
| COUNTIF on a date returns 0 although entries exist on that day | COUNTIF(A2:A500, DATE(2025,12,31)) returns 0 although entries were posted on 31 Dec 2025. | The cells hold a date with a time, such as about 46022.604, which is not equal to 46022. Count with two criteria: ">="&DATE(2025,12,31) and "<"&DATE(2026,1,1). |
| DATEVALUE gives different dates on two laptops, or #VALUE! | =DATEVALUE("03-12-2025") gives 3 Dec 2025 on your laptop but 12 Mar 2025 on a colleague's, and "29-12-2025" gives #VALUE!. | DATEVALUE follows the regional setting. For a fixed layout use DATE(RIGHT(B2,4), MID(B2,4,2), LEFT(B2,2)), which gives the same date everywhere. |
| A night shift shows ######## in the hours column | A shift from 22:00 to 06:00 gives ######## with =C2-B2. | The end is smaller than the start, so the difference is negative and a time cannot be negative. Use MOD(C2-B2, 1). |
| The weekly total shows 18:30 instead of 42:30 | The total of the weekly hours shows 18:30 when the five shifts add up to 42.5 hours. | Format h:mm starts again after 24 hours: 42:30 shows as 18:30. Use [h]:mm, or multiply by 24 and format as a number. |
| Two times that both show 08:30 are not equal | Two times that both show 08:30 are not equal: =B2=C2 returns FALSE. | One of them is calculated and differs from the typed value in the last binary digits. Compare ROUND(B2*1440, 0) with ROUND(C2*1440, 0), which rounds both to whole minutes. |