Use Excel's VALUE Function to Convert Text to Numbers

Convert text data into numeric values

The VALUE function in Excel is used to convert numbers that have been entered as text data into numeric values so that the data may be used in calculations.

The information in this article applies to Excel versions 2019, 2016, 2013, 2010, and Excel for Mac.

of 05

SUM and AVERAGE and Text Data

Converting text data to numbers with the VALUE function in Excel


Excel automatically converts problem data of this sort to numbers, so the VALUE function is not required. However, if the data is not in a format that Excel recognizes, the data can be left as text. When this situation occurs, certain functions, such as SUM or AVERAGE, ignore the data in these cells and calculation errors occur.

For example, in row 5 in the image above, the SUM function is used to total the data in rows 3 and 4 in columns A and B with these results:

  • The data in cells A3 and A4 is entered as text. The SUM function in cell A5 ignores this data and returns a result of zero.
  • In cells B3 and B4, the VALUE function converts the data in A3 and A4 into numbers. The SUM function in cell B5 returns a result of 55 (30 + 25).
of 05

The Default Alignment of Data in Excel

Text data aligns on the left in a cell. Numbers and dates align on the right.

In the example, the data in A3 and A4 align on the left side of the cell because it was entered as text. In cells B2 and B3, the data was converted to numerical data using the VALUE function and aligns on the right.​

of 05

The VALUE Function's Syntax and Arguments

A function's syntax refers to the layout of the function and includes the function's name, brackets, and arguments.

The syntax for the VALUE function is:

Text (required) is the data to be converted to a number. The argument can contain:

  • The actual data enclosed in quotation marks. See row 2 of the example above.
  • cell reference to the location of the text data in the worksheet. See row 3 of the example.

#VALUE! Error

If the data entered as the Text argument cannot be interpreted as a number, Excel returns the #VALUE! error as shown in row 9 of the example.

of 05

Convert the Text Data to Numbers With the VALUE Function

Listed below are the steps used to enter the VALUE function B3 in the example above using the function's dialog box.

Alternatively, the complete function =VALUE(B3) can be typed manually into the worksheet cell.

  1. Select cell B3 to make it the active cell.
  2. Select the Formulas tab.
  3. Choose Text to open the function drop-down list.
  4. Select VALUE in the list to bring up the function's dialog box.
  5. In the dialog box, select the Text line.
  6. Select cell A3 in the spreadsheet.
  7. Select OK to complete the function and return to the worksheet.
  8. The number 30 appears in cell B3. It is aligned on the right side of the cell to indicate it is now a value that can be used in calculations.
  9. Select cell E1 to display the complete function =VALUE(B3) in the formula bar above the worksheet.
of 05

Convert Dates and Times

The VALUE function can also be used to convert dates and times to numbers.

Although dates and times are stored as numbers in Excel and there is no need to convert them before using them in calculations, changing the data's format can make it easier to understand the result.

Excel stores dates and times as sequential numbers or serial numbers. Each day the number increases by one. Partial days are entered as fractions of a day — such as 0.5 for half a day (12 hours) as shown in row 8 above.

Was this page helpful?