Excel Cell Conversion: How to Change Data Types
In this article
Excel cell conversion is the process of changing the data type of a cell's contents—such as turning text into numbers, numbers into text, or dates into a different format. You can do this using built-in tools like Text to Columns, Paste Special, or the Format Cells dialog, depending on whether you need to change the value itself or just its appearance. This article explains the different methods, when to use each, and how to avoid common pitfalls.
Why Cell Conversion Matters
Excel stores every value as one of several data types: number, text, date/time, boolean (TRUE/FALSE), or error. The type determines how the value behaves in formulas. For example, a number stored as text won't be included in SUM() calculations, and a date stored as text can't be used in date arithmetic. Converting cells correctly ensures your data is usable for sorting, filtering, and calculations.
A common scenario is importing data from a CSV file or another system. These imports often bring numbers and dates in as text, especially if the source used leading zeros (like ZIP codes) or non-standard date formats. Without conversion, your data looks correct but behaves incorrectly.
Methods for Converting Cell Types
There are several ways to convert cells, each suited to different situations:
- Format Cells (Ctrl+1) – Changes only the display format, not the underlying value. Use this for dates, currency, percentages, and number of decimal places.
- Text to Columns – Converts text to numbers or dates when the text is in a recognizable format. Found under Data > Data Tools.
- Paste Special > Multiply – Forces text that looks like numbers to become real numbers by multiplying by 1.
- VALUE() function – Converts a text string that looks like a number into a number.
- TEXT() function – Converts a number to text with a specified format.
- Number stored as text warning – Click the green triangle and choose "Convert to Number" for quick fixes.
The method you choose depends on whether you want to change the value, the format, or both.
How to Convert Text to Numbers
When cells contain numbers stored as text (often left-aligned instead of right-aligned), you can convert them using these steps:
- Select the range of cells with the text-numbers.
- Click the warning icon that appears (a yellow diamond with an exclamation mark) and choose "Convert to Number." This works for simple cases.
- If the warning doesn't appear, use Text to Columns: select the column, go to Data > Text to Columns, choose "Delimited," click Next, uncheck all delimiters, click Next, and under Column data format select "General." Click Finish.
- Alternatively, use Paste Special: type 1 in an empty cell, copy it, select your data, right-click > Paste Special > Multiply, then delete the 1.
Method 3 is the most reliable for large datasets. Method 4 works well when the text is exactly a number with no extra characters.
How to Convert Numbers to Text
Sometimes you need numbers as text—for example, to preserve leading zeros in IDs or to concatenate with other text without formatting issues. To convert numbers to text:
- Use the TEXT function:
=TEXT(A1, "0")converts the number in A1 to text without formatting. For leading zeros, use=TEXT(A1, "00000")for a five-digit code. - Use Text to Columns: select the column, go to Data > Text to Columns, choose "Delimited," click Next, uncheck delimiters, click Next, and under Column data format select "Text." Click Finish.
- Use the apostrophe trick: type an apostrophe before the number (e.g., '00123) to force text entry. This works only for manual entry, not for existing cells.
Be aware that converting numbers to text breaks formulas that reference those cells—they will treat the text as zero or error unless you adjust the formulas.
Converting Dates and Times
Dates in Excel are stored as serial numbers (days since January 1, 1900). The display format is separate from the value. To convert a text date to a real date:
- Select the column with text dates.
- Go to Data > Text to Columns.
- Choose "Delimited," click Next, uncheck all delimiters, click Next.
- Under Column data format, select "Date" and choose the format that matches your text (e.g., MDY for 12/31/2023).
- Click Finish.
If the text dates are in a custom format like "2023-12-31", you can use the DATEVALUE function: =DATEVALUE(A1) but it only works with formats Excel recognizes. For truly custom formats, you may need to parse with LEFT, MID, RIGHT and DATE functions.
To change the display of a real date, use Format Cells > Number > Date and pick a format. This does not change the underlying serial number.
Common Mistakes and How to Avoid Them
- Using Format Cells to fix text-numbers – Formatting a text cell as Number does not convert it; the cell remains text. You must use one of the conversion methods above.
- Rounding errors – When converting numbers to text with TEXT(), the result is rounded to the number of decimal places specified. For example,
=TEXT(1.2345, "0.00")returns "1.23", not "1.2345". - Locale issues – Date formats like "MM/DD/YYYY" vs "DD/MM/YYYY" can cause incorrect conversions. Always specify the correct format in Text to Columns.
- Leading zeros lost – Converting text like "00123" to a number turns it into 123. To keep leading zeros, keep the column as text.
- Overwriting original data – Text to Columns and Paste Special modify the selected cells. If you need the original, copy to a new column first.
When to Use Which Method
Choosing the right conversion method depends on your goal:
- If you only want to change how a number looks (decimals, currency, percentage), use Format Cells.
- If you want to change a text number into a real number, use Text to Columns or Paste Special.
- If you want to create a new text column from a number, use TEXT().
- If you want to split a text date into a real date, use Text to Columns.
For one-off small fixes, the green triangle warning is fastest. For large datasets, Text to Columns is more reliable than Paste Special because it handles dates and custom formats.
Frequently Asked Questions
How do I convert a whole column of text to numbers? Select the column, go to Data > Text to Columns, choose Delimited, click Next twice, and under Column data format select General. This converts all text that looks like numbers to numbers.
Why does my number have a green triangle and won't calculate? That's Excel's "Number Stored as Text" warning. The cell is text, not a number. Click the triangle and choose "Convert to Number," or use Paste Special > Multiply by 1.
Can I convert text to a date without using Text to Columns? Yes, you can use the DATEVALUE function if the text is in a date format Excel recognizes. For example, =DATEVALUE("1/1/2023") returns the serial number. For custom formats, use DATE with MID and LEFT.
What's the difference between changing format and converting? Changing format only changes how the value is displayed; the underlying data type stays the same. Converting actually changes the data type—e.g., from text to number. Formatting a text cell as Number does not make it a number.
How do I convert numbers to text with leading zeros? Use the TEXT function with a format code, like =TEXT(A1, "00000") for five digits. Or use Text to Columns and select Text as the column format.
Does Paste Special > Multiply work for negative numbers or decimals? Yes, it works for any number that is stored as text. It multiplies each cell by 1, which forces Excel to interpret the text as a number. It also works for negative numbers and decimals.