Dates and times in Excel: day differences, working hours and times over 24 hours
How Excel stores dates and times, subtracting dates, counting workdays, calculating hours and pay, and why totals over 24 hours need the [h]:mm format.
In Excel a date is a number: the count of days since January 1, 1900. 01.01.2025 is really 45658. Time is a fraction of a day: 12:00 is 0.5, 06:00 is 0.25, one hour is 1/24.
This simple fact explains everything: why you can subtract dates to get the number of days, why a date plus 30 gives a date a month later, and why a total of working hours sometimes looks “weird”. The look is just formatting — inside, it is always a number.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | What | How it looks | Inside Excel | |
| 2 | Date | 01.01.2025 | 45658 | |
| 3 | Time | 12:00 | 0,5 | |
| 4 | Date and time | 01.01.2025 18:00 | 45658,75 | |
| 5 | 1 hour | 01:00 | 0,0416666666667 | |
| 6 | Date +30 days | 31.01.2025 | 45688 | |
| 7 |
Entering and checking a date correctly
1
Type the date in your computer’s format, for example 15.01.2025 (or 1/15/2025 with US settings). If Excel recognizes it, the cell aligns right — it’s a number, a real date.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Date | ||
| 2 | No. 101 | 15.01.20251 | ||
| 3 | No. 102 | 15/01/20252 | ||
| 4 | ||||
| 5 |
2
Insert today’s date quickly with Ctrl + ;, the current time with Ctrl + Shift + ;. These are not formulas — the value is written once and won’t change tomorrow.
3
To see what the cell really holds, press Ctrl + 1 (Format Cells). On the Number tab switch Category to General — a number appears instead of the date. Pick the look you want under Date or Custom.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Date | ||
| 2 | No. 101 | 15.01.2025 | ||
| 3 | ||||
| 4 | ||||
| 5 |
4
The most reliable way to create a date is a formula: =ДАТА(2025;1;15) — year, month, day. It doesn’t depend on regional settings and opens correctly in anyone’s Excel.
Calculating with dates
- Days between:
=B2-A2— the result is a number of days (give the cell General or Number format). - N days later:
=A2+30; N months later:=ДАТАМЕС(A2;3)— handles month lengths for you. - End of month:
=КОНМЕСЯЦА(A2;0); end of next month —=КОНМЕСЯЦА(A2;1). - Number of workdays:
=ЧИСТРАБДНИ(A2;B2)— Saturdays and Sundays excluded. Pass a holiday list as the third argument (March 8, Navruz, Independence Day) and those are excluded too. - Date 10 workdays later:
=РАБДЕНЬ(A2;10). - Date parts:
=ГОД(A2),=МЕСЯЦ(A2),=ДЕНЬ(A2),=ДЕНЬНЕД(A2;2)— 1 is Monday, 7 is Sunday. - Today:
=СЕГОДНЯ()— updates itself every day.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Order | Date | Due date | Month end | Workdays | |
| 2 | No. 101 | 15.01.2025 | 14.02.2025 | 31.01.2025 | 23 | |
| 3 | No. 102 | 07.02.2025 | 09.03.2025 | 28.02.2025 | 21 | |
| 4 | No. 103 | 10.03.2025 | 09.04.2025 | 31.03.2025 | 23 | |
| 5 |
Calculating with time: working hours and pay
Since time is a fraction of a day, “Left − Arrived” gives the time worked: =C2-B2 → 09:00.
But that is not yet a number of hours — it is 0.375 (37.5% of a day). Multiply by 24 to get hours: =(C2-B2)*24 → 9. Only then calculate pay: =E2*25000.
Multiply the time by the hourly rate without the ×24 and the pay comes out 24 times too small — the most common mistake.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Employee | Arrived | Left | Worked | Hours | Pay | |
| 2 | Aziz | 09:00 | 18:00 | 09:00 | 9,0 | 225 000 | |
| 3 | Dilnoza | 08:30 | 17:30 | 09:00 | 9,0 | 225 000 | |
| 4 | Javohir | 10:00 | 19:30 | 09:30 | 9,5 | 237 500 | |
| 5 |
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Day | Worked | ||
| 2 | Monday | 08:00 | ||
| 3 | Tuesday | 07:30 | ||
| 4 | Wednesday | 08:30 | ||
| 5 | Thursday | 07:00 | ||
| 6 | Total (hh:mm) | 07:001 | ||
| 7 | Total ([h]:mm) | 31:002 | ||
| 8 | Total hours | 31,0 | ||
| 9 |
Pro level: night shifts, age and other subtleties
- Shifts past midnight. From 22:00 to 06:00,
=C2-B2returns a negative number and the cell shows####. The correct formula:=ОСТАТ(C2-B2;1)→ 08:00. MOD adds one day to a negative difference. - Full age or length of service:
=РАЗНДАТ(A2;СЕГОДНЯ();"y")— full years;"m"— months,"d"— days. The function exists but isn’t listed in autocomplete — you type its name yourself. - Day name:
=ТЕКСТ(A2;"dddd")→ “Wednesday”. Note: in localized Excel (Russian, for example) the format codes inside TEXT are localized too —"ДД.ММ.ГГГГ"— so English codes give wrong results there. - Dates stored as text (from accounting software or a website):
=ДАТАЗНАЧ(A2), or Данные → Text to Columns → on the last step choose Date: DMY. - Fun fact: Excel treats 1900 as a leap year, so 29.02.1900 “exists” (serial 60). It is a bug kept for compatibility with old Lotus 1-2-3 — for dates before March 1900, weekdays are off by one.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Employee | Arrived | Left | Plain subtraction | With MOD | |
| 2 | Aziz | 22:00 | 06:00 | ######## | 08:00 | |
| 3 | Dilnoza | 21:00 | 07:00 | ######## | 10:00 | |
| 4 | ||||||
| 5 |
Try it in the simulator
The simulator shows dates without formatting — exactly as Excel stores them: 45658 is 01.01.2025, 45724 is 08.03.2025. Type =B2-A2 in C2 (how many days?), =ГОД(B2) in D2 and =ТЕКСТ(B2;"dd.mm.yyyy") in E2.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Start | End | Days | Year | Date as text | |||||||||||||||||||
| 2 | 45658 | 45724 | ||||||||||||||||||||||
| 3 | ||||||||||||||||||||||||
| 4 | ||||||||||||||||||||||||
| 5 | ||||||||||||||||||||||||
| 6 | ||||||||||||||||||||||||
| 7 | ||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.