"Excel as string" usually means two things: converting a number into text so Excel stops reformatting it, and forcing Excel to treat an imported value as literal text instead of a number or date. Both are solved with a handful of tools: the TEXT function, the apostrophe prefix, Text to Columns, Power Query, or a TEXTJOIN/CONCAT combination. The short version: type an apostrophe before a value to keep it exactly as typed for that cell, use =TEXT(A1,"0") or a custom format to convert a range of numbers to strings while keeping the display, and use Power Query's "Text" column type when importing files full of leading zeros, long IDs or values that look like dates.
The reason this matters is that Excel silently guesses data types. A 16-digit card or reference number loses its tail and becomes scientific notation like 1.23457E+15. A part number starting with zero loses the zero. A value like 3-4 becomes 3 April. Once you know how to force text, none of that happens.
What You'll Need
- Excel on Windows, Mac, or the web version (menu labels can differ slightly by version, platform and region; the steps below name Excel desktop on Windows and note where Mac or web differs).
- The data you want to convert, ideally in a copy of the workbook rather than the original.
- For import problems: access to the source file (CSV, TXT or similar) so you can set the column type before the data lands in cells.
Step-by-Step
- Decide which result you need. A number you only need to display as text (a phone number, an ID) can be converted in place. A number you need to keep calculating with should stay numeric; convert only the copy you export or paste elsewhere. Converting the original destroys the numeric value, and formulas referring to that cell may break.
- Fix one value by hand with the apostrophe. Click the cell, type an apostrophe (
') and then the value, for example'0012345. The apostrophe is not stored as a character; it simply tells Excel "this is text". The cell shows a small green triangle in the corner. This is the fastest fix for a handful of cells. - Fix a whole column with Text format. Select the column, right-click and choose Format Cells, then the Number tab, then Text. Or select the cells and use Home > Number Format dropdown > Text. Anything you type into those cells afterwards is kept literally. Note that this does not convert existing numbers; it only applies to new entries.
- Convert existing numbers into real strings with the TEXT function. In an empty column next to your data, enter
=TEXT(A2,"0")for a plain integer, or=TEXT(A2,"00000")to force five digits with leading zeros. For a date, use something like=TEXT(A2,"yyyy-mm-dd"). Fill the formula down, then copy the results and use Paste Special > Values over the original column if you want to replace it. Remember that these results are now text and will no longer sum. - Use Text to Columns to force an imported column to text. Select the column, go to Data > Text to Columns, click Next twice, then on the final screen set the Column data format to Text and click Finish. This is the standard fix for a column of account numbers that Excel has already mangled.
- Do it properly at import with Power Query or the import wizard. For CSV files, use Data > From Text/CSV (or Get Data), then choose Transform Data. In the Power Query editor, click the column header icon and set the type to Text before loading. The old Text Import Wizard (Data > From Text) also lets you mark columns as Text in step 3. This is the only method that stops the damage before it happens.
- Join several cells into one string when needed. Use
=A2&B2&C2for a simple blend, or=TEXTJOIN(", ",TRUE,A2:C2)to combine a range with a separator while ignoring blanks. The result is text; if you need to pass it to another system, this is normally what that system wants. - Clean up converted strings. Text that looks numeric but refuses to sum usually carries a leading apostrophe, a stray space, or a non-breaking space. Use
=TRIM(CLEAN(A2))to strip the common offenders, then re-enter the value. In a pinch, select the range and use Data > Text to Columns with default settings and General format to coerce text back to numbers. - Check the result. Confirm alignment: text is left-aligned by default, numbers right-aligned. Test a few cells with
=ISTEXT(A2)or=ISNUMBER(A2)so you know exactly what type each cell now holds before you export or send the file.
Common Mistakes
- Formatting before converting. Setting a column to Text format does nothing to values already sitting in it. You have to re-enter them or run them through a function or import step.
- Converting everything. Turning a whole ledger into text breaks SUM, AVERAGE and conditional formatting that relies on numbers. Convert only the columns that must remain literal, such as IDs or postal codes.
- Trusting opening an old CSV to be safe. Double-clicking a CSV opens it with Excel's guessed types, so long numbers may already be damaged by the time you look. Import through Power Query or the wizard instead.
- Forgetting locale differences. The TEXT function's format codes are locale-sensitive. A format string like "mm/dd/yyyy" can behave differently on a machine set to a different regional format, so verify on the machine that will open the file.
- Mixing text and numbers in one column. Lookups and pivot tables can silently miss text values that look like numbers. Keep one type per column.
Tips
- Use a fixed-width format like
"0000000000"in TEXT when IDs must keep their leading zeros after export. - Paste Special > Values turns formulas into their results. Paste Special > Values with the cell formatted as Text keeps the displayed string.
- Store the working formula in a helper column and keep the original untouched until you have verified the output.
- If you routinely import the same file, save the Power Query connection. Next time you just refresh it, and the text types are preserved.
- For short lists, the apostrophe is often faster than any formula, and it survives sorting and filtering.
Troubleshooting
If a number still shows in scientific notation, the cell's format or the import type is wrong, not the data; set the column to Text and re-enter or re-import the value. If a converted cell will not sum, check with =ISNUMBER(); if it returns FALSE, the cell is text and needs coercing back with Text to Columns or multiplication by 1. If a date turns into a five-digit number, it has been converted to a serial number; apply a date format or re-run the conversion with a TEXT date format. If leading zeros vanish even after formatting, the value was entered before the format was applied, so re-type it. If results differ between machines, check the regional settings on both. And if a workbook looks corrupted after aggressive find-and-replace, restore from a copy rather than trying to repair cells by hand.
Frequently Asked Questions
How do I quickly convert a number to text in Excel?
For a single cell, type an apostrophe before the value. For a column, use =TEXT(A2,"0") and fill down, or set the cells to Text format before typing.
Why does Excel turn long numbers into scientific notation?
It is treating them as numeric values and switching to compact display. Format the column as Text, or import with the column type set to Text, so the full digits are kept.
Does the apostrophe appear in the cell?
No. It marks the entry as text but is not displayed or counted as part of the value.
Can I convert text back to numbers?
Yes. Use Data > Text to Columns with the General format, or multiply the value by 1 in a helper column, then paste the results back as values.
Why does my converted text still not match in a lookup?
The lookup column is probably a different type, either text or number. Make both columns the same type, or wrap the lookup value accordingly.
Is converting to text permanent?
Only for the cells you change; the original value is replaced. Keep a copy of the source data before converting, since the numeric value cannot be recovered from the text unless it is still parseable.