Excel Text Year: Convert, Extract, and Format Years

How-to basics · Updated November 18, 2026

If a cell contains a year as text, convert it to a number with =VALUE(A2) (assuming A2 contains text such as 2024); the result is the numeric value 2024. If you want the year from a real Excel date, use =YEAR(A2) instead. The right method depends on whether the cell contains a year, a date, or text that merely includes a year.

What “text year” can mean in Excel

People use “Excel text year” to describe several different situations. A cell might contain the four characters 2024 stored as text, a full date such as March 15, 2024 stored as text, or ordinary wording such as “FY2024 budget.” These look similar on a worksheet, but Excel handles them differently. A formula that works for one case may return an error or the wrong result for another.

Start by identifying the contents and the outcome you need:

  • Text containing only a year: convert it to a number if you need arithmetic, numeric sorting, or comparisons.
  • A real date: extract its year with YEAR, or change its display format if you only want to show the year.
  • A date written as text: convert or parse the text as a date before extracting its year.
  • A year inside a label: extract the characters in the appropriate position, then convert them if you need a number.

These distinctions matter in imported reports, copied web data, CSV files, and lists entered by different people. A value that looks like 2024 can be text in one row and a number in the next, making a column behave inconsistently.

How Excel stores dates and years

Excel stores a genuine date as a serial number and uses a cell’s number format to display it as a date. A year is not, by itself, a complete date. The number 2024 is a number, not the date in the year 2024; formatting that number as a date does not reliably create the intended date. If a cell contains a valid date, the displayed appearance can be changed without changing the underlying date value.

This explains an important difference between extracting and formatting. YEAR returns the year number from a valid date. A custom number format such as yyyy changes how a date appears but leaves the full date available for calculations. The TEXT function can also display a date as a four-digit year, but its result is text, not a numeric year.

Excel for Microsoft 365 on Windows normally uses the 1900 date system. Some workbooks can use the 1904 date system, a compatibility setting that changes date serial values. For everyday use, formulas such as YEAR work with valid dates in the workbook’s date system. The distinction is most important when exchanging workbooks or raw serial numbers; a serial number copied without its date context is not self-explanatory.

Convert a year stored as text to a number

Suppose A2 contains the text 2024 and you want a numeric value you can use in calculations. With text years in A2:A100, enter this in B2 and fill it down: =VALUE(A2). For A2 containing the text 2024, the result is the number 2024. VALUE converts text that Excel recognizes as a number; it does not turn an arbitrary label into a year.

Text and numbers can look identical in the grid, so a quick check can help. With the value being checked in A2, =ISTEXT(A2) returns TRUE if Excel considers it text; for the text 2024, the result is TRUE. With the same cell layout, =ISNUMBER(A2) returns FALSE for that text value and TRUE if A2 contains the numeric value 2024. These checks are useful when an imported column mixes types. They describe the cell’s current type; they do not repair it.

After conversion, use the numeric results for calculations or comparisons. For example, a numeric year can be compared with a cutoff year or used in a PivotTable grouping. Keep the original imported column until you have checked the converted values, especially if the source may contain blanks, spaces, or notes mixed in with years. VALUE will return an error for text it cannot interpret as a number, which is a useful signal to inspect that row rather than assume the entire column converted cleanly.

Extract a year from a real date

If A2 contains a genuine Excel date representing March 15, 2024, and you want the year as a number, enter =YEAR(A2). The result is 2024. YEAR works on the date value, even if the cell is currently displayed as 3/15/2024, Mar-24, or another date format. The displayed format does not determine what YEAR returns.

If the goal is only to display the date’s year, you may not need a formula. Select the date cells, open Home > Number Format, choose More Number Formats, select Custom, and enter yyyy in the Type box. A date such as March 15, 2024 then displays as 2024, while the underlying value remains March 15. This is useful when you still need to sort or calculate using complete dates. To show the month as well, a format such as mmm yyyy displays Mar 2024 without removing the day from the stored date.

If you need a text label rather than a numeric result, use TEXT. With an actual date in A2, =TEXT(A2,"yyyy") returns the text 2024. That can be convenient for concatenating a year into a label, but it is not interchangeable with the numeric result from YEAR. For numeric comparisons or calculations, prefer YEAR or the underlying date.

Get the year from a date written as text

A text date is not necessarily a valid Excel date. For example, a cell may contain the characters 2024-03-15 rather than a date value. One option is DATEVALUE, which asks Excel to interpret recognizable date text according to the workbook’s regional date settings. Because text-date interpretation can vary by locale and source format, test it on representative rows before filling a formula down a large imported dataset.

For a consistent ISO-style text date in the exact year-month-day pattern YYYY-MM-DD, you can parse the parts explicitly. If A2 contains the text 2024-03-15, =YEAR(DATE(VALUE(LEFT(A2,4)),VALUE(MID(A2,6,2)),VALUE(RIGHT(A2,2)))) returns 2024. LEFT reads the first four characters, MID reads the two characters beginning at position six, and RIGHT reads the final two; DATE builds a real date from those numeric parts before YEAR extracts its year. This formula assumes fixed-width values with hyphens in those positions. It is not a general parser for dates with different separators or ordering.

If your data uses a different layout, identify the positions and meaning of each part before writing a formula. For example, 03/04/2024 can mean March 4 or April 3 depending on the source’s convention. Excel cannot infer the intended interpretation from the characters alone. Confirm the source format or regional convention before converting ambiguous dates, and check the resulting dates against known examples.

Extract a year from a label or longer text

When a year appears in a predictable place within ordinary text, text functions can isolate it. If A2 begins with a four-digit year, as in “2024 budget,” =VALUE(LEFT(A2,4)) returns the numeric year 2024. This assumes the first four characters are digits representing the year. If A2 contains “FY2024,” =VALUE(RIGHT(A2,4)) also returns 2024, but only because the year is at the end and has exactly four digits.

Do not apply a fixed-position formula to a column whose labels vary unpredictably. “Budget 2024 draft,” “FY24,” and “2024-25 plan” do not all follow the same structure. A formula that takes the first or last four characters could return part of a word, a two-digit year, or the wrong year. Standardizing the source data, separating labels from years, or using a documented rule for each format is safer than forcing one formula onto dissimilar values.

For a one-time cleanup, it may be quicker to split a consistently delimited field with Excel’s Text to Columns feature. For recurring imports, preserve the raw source and use a repeatable transformation that matches its actual structure. In either case, check a sample of converted rows, including the shortest, longest, and least typical labels.

Common problems and how to choose a method

A frequent problem is that a text year sorts alphabetically rather than numerically. Four-digit years such as 2022 and 2024 happen to sort in the expected order as text, but mixed lengths such as “999” and “1000” do not sort as numeric values. Text years can also fail numeric comparisons or leave formulas that expect numbers returning unexpected results. Converting the column is preferable when the year represents a quantity or comparison value.

Another common misconception is that changing a cell’s number format converts text into a number or date. Number formats control how numeric values and dates are displayed; they do not parse arbitrary text. If a text year remains unchanged after applying a number format, use a conversion method such as VALUE, then format the resulting numeric cell as needed.

Choose the approach by asking what the source really contains and what the output must do:

  • For text containing only four year digits, use VALUE to create a number.
  • For a valid Excel date, use YEAR for a numeric year, or apply a year-only date format to change appearance.
  • For a text date, parse it using a method appropriate to its exact layout and regional meaning.
  • For a year embedded in a label, extract characters only when the position is consistent.
  • For a label that should remain text, use TEXT on a valid date or combine a numeric year with other text deliberately.

When a formula returns an error, inspect spaces, blank cells, punctuation, and inconsistent formats before changing the formula. A trailing space may make an otherwise numeric-looking value harder to interpret, and a date imported with an unexpected order may be converted incorrectly without producing an obvious error. Keep a copy of the original data and verify both the type and meaning of the results.

Frequently Asked Questions

How can I tell whether a year is text or a number?
With the year in A2, =ISTEXT(A2) returns TRUE for text and =ISNUMBER(A2) returns TRUE for a number. The two checks help identify mixed data, but they do not determine whether a number is a complete date.

Why does YEAR return an error for my year?
YEAR expects a valid date value, not just text such as “2024.” Convert a year-only text value with VALUE if you need the number 2024. If the cell contains a full date as text, parse that text as a date first.

How do I show only the year without changing the date?
Apply a custom date format of yyyy to a valid date cell. The cell will display its year while retaining the complete date for sorting and date calculations.

Does TEXT return a number or text?
TEXT returns text. For example, formatting a date with the yyyy pattern produces characters such as 2024. Use YEAR when you need a numeric year for calculations or comparisons.

Why did my imported date turn into the wrong year or month?
The source may use a different date order or regional convention, or Excel may have interpreted text differently during import. Confirm the source format and test conversions against known dates before relying on the results.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.