How To Convert Text to Numbers in Excel

Alan Murray, contributor to the CareerFoundry blog

A common frustration in Excel is when numbers are stored as text.

You will not be able to perform Excel tasks such as mathematical calculations, create charts from the values, or group them into ranges while the numbers are stored as text.

In this tutorial, you will learn how to recognize numbers stored as text and multiple ways to convert text to numbers.

Here’s what we’ll cover:

  1. How to check if a value is numeric or text
  2. The ‘Convert to Number’ Excel option
  3. Change text to numbers with Paste Special
  4. Using Text to Columns to convert text
  5. Convert text to numbers using formulas

You can follow along with this workbook.

1. How to check if a value is numeric or text

It is not always clear that a number is stored incorrectly. It can appear as a number, yet be stored as text. This causes much confusion for Excel users.

However, there are some things to look out for, and ways to accurately check it.

Firstly, Excel will always display text to the left of a cell and numeric values to the right of a cell. So, if a value is left-aligned, it is probably text.

This is just a clue and not guaranteed, because users can change the alignment of cell values. However, it is a great place to start and a good clue to look out for.

Another way of checking is to select the range of values and look at the calculations down on the Status Bar.

If the values are all numeric, you will probably see average, count and sum calculations. And if any are text, only the count is performed.

A simple Excel spreadsheet containing data for "name" and "number of phone calls." A red arrow has been added to annotate the word "count" which is shown in the bottom right, indicating that some number values have actually been stored as text

Once again, these calculations can be changed by users so it’s not a perfect check. However, it will work 95% of the time and is a fast and easy way of checking.

To be completely sure, we can use an Excel function named ISNUMBER. This function will return TRUE if the value is numeric and FALSE if it is not.

You only need to provide the ISNUMBER function with the value to check. In this example, the following formula was entered into cell C2.

=ISNUMBER(B2)

I have converted some of the values to numbers. So, even though they all look like numbers, the ISNUMBER formula returns FALSE, making it easy to identify the problem values.

An Excel spreadsheet containing data for "name" and "number of phone calls." The =ISNUMBER(B2) formula has been entered, with the third column containing either "true" or "false" depending on whether the data has been stored as a number or as text.

2. The ‘Convert to Number’ Excel option

The first technique we will look at to convert text to numbers is the ‘Convert to Number’ option provided in Excel.

It is quick and simple, but it is unfortunately not always available to you.

This option is available when numbers are stored as text as a result of downloading the data from a website or some database, or maybe copied and pasted between programs.

Also, it may be that someone accidentally typed an apostrophe before the number. This tells Excel to store the number as text, and is very useful for entering ‘fake’ numbers such as phone numbers and ID numbers.

A green triangle is shown in the top left corner of the cell if this option is available to you.

An Excel spreadsheet containing two columns of data, one for "name" and one for "number of phone calls." There is a small green triangle in the top left corner of the cells beneath the "phone calls" column.

This triangle means that the value has failed one of Excel’s error check rules, and is used to identify other errors outside of just recognizing numbers stored as text.

To convert to numbers;

  1. Select the range of cells to change.
  2. Click the exclamation mark icon and click Convert to Number.

An Excel spreadsheet containing two columns of data, one for "name" and one for "number of phone calls." There is a red arrow highlighting step one, which is to click on the arrow that appears next to the cell you want to change. There is a second red arrow highlighting the second step, which is to select “convert to number” from the dropdown menu.

The values are converted. The green triangle has disappeared and the values are now right aligned. This is how we expect to see numbers.

An Excel spreadsheet containing two columns of data, one for "name" and one for "number of phone calls."

3. Change text to numbers with Paste Special

Paste Special in Excel is a fabulous tool. It is no surprise that it can help us convert text to numbers too.

To do so, we need to use Paste Special to perform a simple calculation. When a text value is used in a calculation, the result is numeric.

  1. Type the number 1 in a cell, any cell.
  2. Copy that cell value.
  3. Select the range of values you need to convert to numbers.
  4. Click Home > Paste list arrow and Paste Special.

An Excel spreadsheet containing two columns of data, one for "name" and one for "number of phone calls." There is a red arrow pointing to a cell which has been selected. A second red arrow annotates a range of cells that have been highlighted in the “phone calls” column. A third arrow is pointing to the “paste” option in the Excel toolbar. A fourth arrow is pointing to the “paste special” option available in the drop-down menu.

5. Select Values and the Multiply operation. Click Ok.

The dialog box which appears when you select "paste special" in Excel. The "values" and "multiply" options have both been checked.

4. Using Text to Columns to convert text

Text to columns is another great way to quickly convert text to numbers.

  1. Select the range of values.
  2. Click Data > Text to Columns.
  3. Step 1 of the Text to Columns wizard regards splitting text between columns. We do not need this, so click Next.

The "convert text to columns" window that pops up when you opt to change text to columns in an Excel spreadsheet

4. In step 2 remove all delimiter checkboxes.

Step two of the "convert text to columns" window in Excel. All delimiters have been deselected.

5. Step 3 asks about the value formatting. Leave it as General (the date option is great when working with date values). Click Finish.

Step three of the "convert text to columns" window in Excel. The "general" option has been selected and the "finish" button highlighted.

You probably didn’t change an option during the Text to Columns process, and we could have clicked Finish before step 3.

However, you may have to consider if your value contains delimiters such as spaces or commas.

I like this method of converting text to numbers. It is quick and simple.

5. Convert text to numbers using formulas

The previous methods are great, but they require manual intervention. A user will need to perform the steps to convert the text to numbers.

With a formula, we can automate the solution. It will not change the value in the cell containing text, but rather, create a clean version in another cell.

If the data is regularly changed, a formula will ensure that the values fed to a PivotTable, chart or other formulas continue to be numeric. And no manual intervention is required.

Using a formula is also great for combining with other functions. For example, converting results from text functions into numbers.

That is the example we will look at here.

In this example, we have data downloaded from a source and the values in column B are stored as text due to the dollar sign.

Using a formula, the number has been extracted successfully. However, the RIGHT and LEN functions used in the formula are text functions. So, the result is returned as text.

An Excel spreadsheet containing three columns of data: name, value, number. The first cell in the “number” column has been highlighted and a formula entered into the formula bar.

The VALUE function of Excel converts text that represents a number to a number.

Using this function, the result of the RIGHT function is converted from text to number.

An Excel spreadsheet containing three columns of data: name, value, number. The first cell in the “number” column has been highlighted and the "VALUE" formula entered into the formula bar.

The values can then be formatted as required. For example, in the accounting format with the dollar sign.

Final thoughts and further reading

So there you have it: some simple methods for converting text to numbers. If you’re getting to grips with Excel in your quest to become a data analyst, you can try a free data analytics short course here. Keen to learn more Excel functions? Check out the following:

What is CareerFoundry?

CareerFoundry is an online school for people looking to switch to a rewarding career in tech. Select a program, get paired with an expert mentor and tutor, and become a job-ready designer, developer, or analyst from scratch, or your money back.

Learn more about our programs
blog-footer-image