Convert text to number excel

It’s common to find numbers stored as text in Excel. This leads to incorrect calculations when you use these cells in Excel functions such as SUM and AVERAGE [as these functions ignore cells that have text values in it]. In such cases, you need to convert cells that contain numbers as text back to numbers.

Now before we move forward, let’s first look at a few reasons why you may end up with a workbook that has numbers stored as text.

  1. Using ‘ [apostrophe] before a number.
    • A lot of people enter apostrophe before a number to make it text. Sometimes, it’s also the case when you download data from a database. While this makes the numbers show up without the apostrophe, it impacts the cell by forcing it to treat the numbers as text.
  2. Getting numbers as a result of a formula [such as LEFT, RIGHT, or MID]
    • If you extract the numerical part of a text string [or even a part of a number] using the TEXT functions, the result is a number in the text format.

Now, let’s see how to tackle such cases.

Convert Text to Numbers in Excel

In this tutorial, you’ll learn how to convert text to numbers in Excel.

The method you need to use depends on how the number has been converted into text. Here are the ones that are covered in this tutorial.

  • Using the ‘Convert to Number’ option.
  • Change the format from Text to General/Number.
  • Using Paste Special.
  • Using Text to Columns.
  • Using a Combination of VALUE, TRIM, and CLEAN function.

Convert Text to Numbers Using ‘Convert to Number’ Option

When an apostrophe is added to a number, it changes the number format to text format. In such cases, you’ll notice that there is a green triangle at the top left part of the cell.

In this case, you can easily convert numbers to text by following these steps:

  • Select all the cells that you want to convert from text to numbers.
  • Click on the yellow diamond shape icon that appears at the top right. From the menu that appears, select ‘Convert to Number’ option.

This would instantly convert all the numbers stored as text back to numbers. You would notice that the numbers get aligned to the right after the conversion [while these were aligned to the left when stored as text].

Convert Text to Numbers by Changing Cell Format

When the numbers are formatted as text, you can easily convert it back to numbers by changing the format of the cells.

Here are the steps:

  • Select all the cells that you want to convert from text to numbers.
  • Go to Home –> Number. In the Number Format drop-down, select General.

This would instantly change the format of the selected cells to General and the numbers would get aligned to the right. If you want, you can select any of the other formats [such as Number, Currency, Accounting] which will also lead to the value in cells being considered as numbers.

Also read: How to Convert Serial Numbers to Dates in Excel

Convert Text to Numbers Using Paste Special Option

To convert text to numbers using Paste Special option:

Convert Text to Numbers Using Text to Column

This method is suitable in cases where you have the data in a single column.

Here are the steps:

  • Select all the cells that you want to convert from text to numbers.
  • Go to Data –> Data Tools –> Text to Columns.
  • In the Text to Column Wizard:

While you may still find the resulting cells to be in the text format, and the numbers still aligned to the left, now it would work in functions such as SUM and AVERAGE.

Convert Text to Numbers Using the VALUE Function

You can use a combination of VALUE, TRIM and CLEAN function to convert text to numbers.

  • VALUE function converts any text that represents a number back to a number.
  • TRIM function removes any leading or trailing spaces.
  • CLEAN function removes extra spaces and non-printing characters that might sneak in if you import the data or download from a database.

Suppose you want convert cell A1 from text to numbers, here is the formula:

=VALUE[TRIM[CLEAN[A1]]]

If you want to apply this to other cells as well, you can copy and use the formula.

Finally, you can convert the formula to value using paste special.

You May Also Like the Following Excel Tutorials:

  • Multiply in Excel Using Paste Special.
  • How to Convert Numbers to Text in Excel
  • Convert Formula to Values Using Paste Special.
  • Excel Custom Number Formatting.
  • Convert Time to Decimal Number in Excel
  • Change Negative Number to Positive in Excel
  • How to Capitalize First Letter of a Text String in Excel
  • Convert Scientific Notation to Number or Text in Excel
  • How To Convert Date To Serial Number In Excel?

How do I convert text to Number Format in Excel?

Select all the cells that you want to convert from text to numbers. Click on the yellow diamond shape icon that appears at the top right. From the menu that appears, select 'Convert to Number' option.

Why can't I convert text to numbers in Excel?

On the Tools menu, click Options. In the Options dialog box, click the Error Checking tab. In the Settings section, click to select the Enable background error checking check box. In the Rules section, make sure the Number stored as text rule is selected, and then click OK.

How do I convert text to numbers in Excel using keyboard?

Select the cells you want to convert to numbers, right-click, and then click Paste Special. Alternatively, press the Ctrl + Alt + V shortcut. In the Paste Special dialog box, select Values in the Paste section and Add in the Operation section. Click OK.

How do I convert Excel cells to numbers?

Here's how you can change the format to Number: Select the cells that have the data you want to reformat. Click Number Format > Number. Tip: You can tell a number is formatted as text if it's left-aligned in a cell.

Chủ Đề