Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel DateTime Functions: How to Use Them

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Excel does not have a single function literally called "datetime" — instead it stores dates and times as serial numbers and gives you a family of functions to build, extract, and combine them. The three you will use most are TODAY(), NOW(), and the input function DATE(year, month, day), combined with TIME(hour, minute, second) to add a clock time. Once you understand that a date is just a number and a time is a fraction of a day, everything else — adding days, finding a weekday, calculating working hours — becomes simple arithmetic with a function wrapper. Below is a practical walkthrough for building, formatting, and calculating with date-times in any current version of Excel, plus the traps that cause most "wrong number" errors.

What You'll Need

  • Excel for Microsoft 365, Excel 2021, Excel 2019, Excel for Mac, or Excel on the web — the functions below exist in all of them.
  • A blank worksheet with one column for your date values.
  • Your regional date format in mind (day/month/year vs month/day/year), because typing dates depends on your system settings.
  • Optional: data you want to combine, such as separate date and time columns.

Step-by-Step

  1. Understand the serial number. In a new cell, type =TODAY() and press Enter. Excel shows today's date, but if you select the cell and change its format to Number with zero decimals, you see an integer such as 46000. That integer is days since 1 January 1900 in the default Windows system. Type =NOW() instead and the Number format gives a decimal: the whole part is the date, the fraction is the time of day (0.5 is noon). This single idea explains almost every confusing result later.
  2. Format the cell as a date-time. Select the cell, press Ctrl+1 (Cmd+1 on Mac) to open Format Cells, choose Date or Custom, and pick a pattern such as dd/mm/yyyy hh:mm. The underlying value does not change — only the display does. The Format Cells dialog labels differ slightly by version and region, but the Custom category is always there.
  3. Build a date from parts. Use =DATE(2025,3,14) for 14 March 2025. This is safer than typing "14/03/2025" because it ignores regional ambiguity. If month or day is out of range, Excel rolls over: =DATE(2025,13,1) returns 1 January 2026.
  4. Build a time from parts. Use =TIME(9,30,0) for 9:30 AM. The arguments must be whole numbers within range (hours 0–23, minutes and seconds 0–59), otherwise you get #NUM!.
  5. Combine date and time. Add the two results together: =DATE(2025,3,14)+TIME(9,30,0) returns that date at 9:30 AM. To merge an existing date column A and time column B, use =A2+B2. Excel handles the addition natively — no concatenation needed.
  6. Add or subtract intervals. To add 7 days: =A2+7. To add 3 hours: =A2+TIME(3,0,0) or =A2+3/24. To add 90 minutes: =A2+TIME(0,90,0). Never add 1 to a time to mean "one hour" — adding 1 adds a full day.
  7. Extract the parts. =YEAR(A2), =MONTH(A2), =DAY(A2) pull out the calendar fields. =HOUR(A2), =MINUTE(A2), =SECOND(A2) pull out clock fields. =WEEKDAY(A2) returns 1–7, where 1 is Sunday by default; add 2 as a second argument to make Monday equal 1.
  8. Find the difference between two date-times. Simply subtract: =B2-A2. Format the result as a number to see total days and decimals, or as [h]:mm to see total hours even past 24. Bracket the h in a Custom format to stop Excel wrapping hours at midnight.
  9. Use DATEDIF for full units. =DATEDIF(A2,B2,"y") gives completed years, "m" completed months, "d" days. Despite being hidden from the function list, DATEDIF is reliable in all current versions. Pair it with YEARFRAC if you need a decimal year.
  10. Round times sensibly. Use =MROUND(A2,TIME(0,15,0)) to round to the nearest quarter hour, or =FLOOR(A2,1/24) to drop the time to the start of the hour. This is useful for timesheet reporting.
  11. Calculate working days. =NETWORKDAYS(A2,B2) counts business days between two dates and skips weekends. Add a holiday range as the third argument to exclude public holidays you list in your own column.

Common Mistakes

  • Treating "1:30" typed in as text as a time. If a value is left-aligned by default, Excel stored it as text and any arithmetic on it returns #VALUE!. Retype it or use Data > Text to Columns to convert.
  • Adding whole numbers to times. 1 means one day. A 6:00 PM shift plus 1 becomes 6:00 PM two days later — a common source of off-by-a-day mistakes in timesheets.
  • Confusing the display with the value. A cell showing "14/03/2025" may contain a text string or a number. Change the format to General to check: a real date turns into an integer.
  • Ignoring the 1900 leap-year bug. Excel inherited an error where 29 February 1900 is treated as valid. It matters only if you work with dates before March 1900.
  • Using DATEDIF with a start later than the end. It returns #NUM! rather than a negative number; swap the arguments or test with IF.

Tips

  • Press Ctrl+; to insert a static todays-date, and Ctrl+Shift+; for a static current time. Unlike TODAY/NOW, these do not update on recalculation.
  • Freeze a calculated date-time with Paste Special > Values before sending the workbook to someone who may open it on another day.
  • Wrap volatile functions — TODAY, NOW — with a manual recalculation setting if a large workbook feels slow, since they recalculate on every edit.
  • Keep raw date silence in one column and created strings only for presentation. Never overwrite the underlying values with a formatted label.

Troubleshooting

If a formula returns a five-digit number instead of a date, the cell is formatted as General. Fix it with Format Cells > Date. If it returns #####, the column is too narrow or the value is negative — dates before 1900 cannot be displayed as dates. If TODAY or NOW shows an unchanged date, check for Manual calculation under Formulas > Calculation Options and switch it back to Automatic. If times display as decimals, apply a Time format. If subtraction gives an error, one of the two cells is text: select it, look at the alignment, and use Data > Text to Columns or retype it. Finally, if your dates look shifted by a day, check the system region setting, since Excel uses your locale to interpret two-digit years and ambiguous inputs.

Frequently Asked Questions

Is there a single DATETIME function in Excel?

No. Date-time values are built by adding the DATE function to the TIME function, or by adding a date cell to a time cell.

Why does NOW() return a number with decimals?

The decimal part is the time of day as a fraction of 24 hours. Format the cell as a date-time to see it readably.

How do I remove the time from a cell that contains date and time?

Use =INT(A2). It strips the fractional part and leaves the date only.

Can I calculate elapsed time across more than 24 hours?

Yes. Format the result with a custom format of [h]:mm so Excel does not wrap at midnight.

Why does DATEDIF not appear in the function list?

It is a legacy function kept for compatibility. It still works when typed manually.

Do these formulas work the same in Excel on the web?

Yes. DATE, TIME, TODAY, NOW, and DATEDIF behave the same, though some shortcut keys differ in the browser.