Dates and Times

How to Work With Dates in Excel

How Excel stores dates, how to enter and format them, and how to add, count and pull apart dates, plus fixes for the most common date problems in Excel.

On this page
  1. How Excel stores a date
  2. Enter dates Excel will recognize
  3. Format a date the way you want
  4. Today’s date and the current time
  5. Add and subtract dates
  6. Pull out the year, month or day
  7. Count working days
  8. Work with times
  9. When dates misbehave
  10. Test before you fill a column

Excel stores every date as a number, and a number format decides how that number looks. This is why you can subtract one date from another, add days to a date, and sort a column of dates into order. To work with dates reliably, enter them so Excel recognizes them, format them the way you want, and use date functions for anything that involves counting or moving them. Each section below covers one part of the job.

How Excel stores a date

In the default Windows date system, January 1, 1900 is day 1, and each later day adds 1 to the number. So January 1, 2023, is stored as 44927. Excel generally can’t store dates before January 1, 1900, as dates.

Some workbooks, especially ones made on older Mac versions, use the 1904 date system instead. The same number then displays as a date about four years later. The setting belongs to the workbook, so check it when dates from two files don’t line up.

Enter dates Excel will recognize

Type a date with slashes or hyphens, such as 3/14/2026, or with a month name, such as 14 Mar 2026. Excel reads it as a date when it understands the pattern. The order of day and month depends on your region settings. In a US setting, 04/05/2026 is April 5. In a UK setting, the same text is 4 May.

A recognized date is right-aligned in its cell by default. Text is left-aligned, so alignment is a quick way to spot a date Excel didn’t recognize.

Inside a formula, avoid typing a date in quotation marks. Excel reads that text according to your region settings, so the result can change from one computer to another. The DATE function is the safer choice, and it’s covered in excel date function from year month day.

Format a date the way you want

Select the cells, press Ctrl+1 (Cmd+1 on a Mac), choose Date, and pick a style. For more control, use a custom format such as mmm d, yyyy, which shows March 14, 2026 as Mar 14, 2026. A format changes only how a date looks. The number underneath stays the same, so formulas and sorting keep working.

Today’s date and the current time

=TODAY() returns today’s date. It recalculates when the workbook recalculates, so the result changes from day to day. =NOW() returns the date and the time. To type a date that won’t change, press Ctrl+; on Windows. Ctrl+Shift+; types the current time.

Add and subtract dates

Because dates are numbers, =A2+30 returns the date 30 days after the date in A2. Subtracting one date from another gives the number of days between them. Months are different, because they don’t all have the same length. For months, use EDATE, as covered in how to add months to a date in excel. For a plain count of days, see how to count days between two dates in excel.

Pull out the year, month or day

YEAR, MONTH and DAY return one part of a date as a number, and WEEKDAY returns the day of the week as a number. These parts are useful for grouping and for calculations such as age. The method for age is in how to calculate age from birthdate in excel.

To find the last day of a month, use EOMONTH, which is covered in last day of month formula in excel. A pivot table can also group dates by month for you, and the steps are in group dates by month in pivot table.

Count working days

NETWORKDAYS counts Monday through Friday between two dates. If you give it a list of holidays, it skips those too. The details, including how to use weekend patterns other than Saturday and Sunday, are in networkdays excel exclude weekends and holidays.

Work with times

Excel stores a time as a fraction of a day. Noon is 0.5, and 6:00 AM is 0.25. Subtracting one time from another gives the elapsed time. The steps, including shifts that cross midnight, are in how to calculate time difference in excel.

When dates misbehave

Three problems come up most often:

  • The date shows as a number. The cell is usually formatted as General or Number. Changing the format fixes the display, and the reasons are in why does excel show date as number.
  • Excel doesn’t treat the entry as a date. Text that doesn’t match your region’s day and month order stays text, and so does text with hidden spaces. Sorting and date math then go wrong. The fixes are in excel not recognizing dates as dates.
  • A formula returns an error. #VALUE! often means a date is stored as text. How to clear it is covered in how to fix #value error in excel.

Test before you fill a column

Try a date formula on two or three rows first. Check that the result is a date, a number or a time, as you expect, and that the format is right. Then copy the formula down the rest of the column.

Keep exploring

Guides from other topics

All topics →