Smart Systems for Home

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

Excel YEAR Formula: Extract Year from a Date

· 5 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

To get the year from a date in Excel, use the YEAR function: =YEAR(A1). If A1 contains a valid Excel date such as 15/03/2024, the formula returns 2024 as a plain number. That is the whole answer for most people. The rest of this guide covers making sure your dates are real dates, formatting the result, handling text that looks like a date, and the errors you are most likely to hit.

What You'll Need

  • A version of Excel that supports the YEAR function. It has been in Excel for desktop (Windows and Mac), Excel for the web, and the mobile apps for a long time, so any current version works.
  • At least one cell containing a date that Excel recognises as a date, not as text.
  • An empty cell for the formula result.

Step-by-Step

  1. Confirm the source cell holds a real date. Click the cell with the date and look at the formula bar at the top of the window. If the formula bar shows something like 15/03/2024 or 3/15/2024, it is a real date. If it shows text such as March 15 2024 typed as a string, or the value is left-aligned in the cell while numbers are right-aligned, Excel may be treating it as text and YEAR will fail. The exact date format shown depends on your regional settings.
  2. Select an empty cell where you want the year to appear, for example B1 next to your date in A1.
  3. Type the formula. Enter =YEAR(A1) and press Enter. Replace A1 with the reference to your own date cell. You can also type =YEAR( and then click the date cell to insert the reference automatically.
  4. Check the result. The cell should show a four-digit year such as 2024. It is a number, so it can be sorted, filtered, compared, or used inside other formulas.
  5. Copy the formula down if needed. Drag the small fill handle at the bottom-right corner of the formula cell down the column, or double-click it, to apply the same formula to a whole list of dates.
  6. Format the result if it looks wrong. If the cell shows something like 1/1/1905 or a date instead of a year, the cell is formatted as a date. Select the result cells, open the Number Format dropdown on the Home tab, and choose General or Number. The value is correct; only the display is off.
  7. Optional: combine with other functions. To pull the year from a date typed directly into the formula, use =YEAR(DATE(2024,3,15)). To get the current year, use =YEAR(TODAY()). To extract the year from a text string that is not a real date, wrap it in DATEVALUE first, for example =YEAR(DATEVALUE("15/03/2024")), using a format your regional settings recognise.

Common Mistakes

  • Passing text instead of a date. YEAR expects a date serial number. If the cell contains text that merely looks like a date, you get a #VALUE! error. Fix the source data or use DATEVALUE.
  • Confusing YEAR with the display format. Changing a date cell to show only the year does not change the underlying value; it is still a full date. Use YEAR when you need the year as a separate number for calculations or grouping.
  • Leaving the result formatted as a date. A year like 2024 shown in date format can appear as 1/1/1905 because Excel counts days from its starting date. Switch the cell to General or Number.
  • Using YEAR on an empty cell. An empty cell is treated as zero, which corresponds to 1900, so YEAR returns 1900. Guard against blanks with =IF(A1="","",YEAR(A1)).
  • Assuming the formula changes the original date. YEAR only reads the date. If you want to replace the dates with years, copy the results and paste them as values over the original column.

Tips

  • To group sales or records by year, add a YEAR helper column and then use a PivotTable with that column as a row field.
  • YEAR works with any function that returns a date, including TODAY, DATE, and date arithmetic results, so =YEAR(A1+30) gives the year 30 days after the date in A1.
  • If your dates come from a CSV import and are stored as text, use Data > Text to Columns or the DATEVALUE function to convert them before applying YEAR.
  • For month and day extraction, the companion functions are MONTH and DAY, used the same way.

Troubleshooting

  • #VALUE! error. The referenced cell is text, not a date. Check the formula bar and the cell alignment, then convert the text to a real date.
  • Result is 1900 or 1905. The source cell is empty or zero, or the result cell is formatted as a date. Fill the source or change the number format.
  • Result is a full date. The formula is fine; the cell format is wrong. Set it to General or Number.
  • Formula shows as text. The cell may be formatted as Text before you typed the formula. Change the format to General and re-enter the formula.
  • Wrong year for some rows. Those rows likely contain dates in a different regional order (for example day/month swapped). Correct the source data or use DATE with explicit year, month and day arguments.

Frequently Asked Questions

What does the YEAR function return?

It returns the year of a date as a four-digit number, from 1900 to 9999, depending on the date supplied.

Can I get the year from a date typed directly into the formula?

Yes. Use =YEAR(DATE(2024,3,15)) or a date string that your regional settings recognise, wrapped in DATEVALUE if needed.

How do I get the current year in Excel?

Use =YEAR(TODAY()). The result updates whenever the workbook recalculates.

Why does YEAR return 1900 for an empty cell?

Excel treats an empty cell as zero, and zero corresponds to the start of its date system. Use an IF check to return a blank instead.

Does YEAR work in Excel for the web and mobile?

Yes, the function is available in Excel for the web and the Excel mobile apps, with the same syntax.

How is YEAR different from formatting a date to show only the year?

Formatting changes only how the date is displayed; the underlying value remains a full date. YEAR extracts the year as a separate number you can calculate with.