How to Use VALUE Function in Excel: Convert Text to Number Easily
The
VALUE function in Excel converts text that appears as a number into a real numeric value. This helps when numbers are stored as text and you want to perform calculations on them.Syntax
The VALUE function has a simple syntax with one argument:
- text: The text string you want to convert to a number.
This text can be a number stored as text, a date, or a time in text format.
excel
VALUE(text)
Example
This example shows how VALUE converts text to a number so you can use it in calculations.
excel
A1: "123" B1: =VALUE(A1) A2: "12/31/2023" B2: =VALUE(A2)
Output
B1: 123
B2: 45117
Common Pitfalls
Sometimes numbers look like text but contain extra spaces or non-printable characters, causing VALUE to return an error. Also, if the text is not a valid number, VALUE will give a #VALUE! error.
To fix this, use TRIM to remove spaces or check the text format before using VALUE.
excel
Wrong: =VALUE(" 123 ") // Usually works despite spaces Right: =VALUE(TRIM(" 123 ")) // Removes spaces first
Quick Reference
| Function | Description | Example | Result |
|---|---|---|---|
| VALUE(text) | Converts text to number | VALUE("456") | 456 |
| TRIM(text) | Removes extra spaces | TRIM(" 789 ") | "789" |
| ISNUMBER(value) | Checks if value is a number | ISNUMBER(VALUE("123")) | TRUE |
Key Takeaways
Use VALUE to convert numbers stored as text into real numbers for calculations.
VALUE only needs one argument: the text to convert.
If text has extra spaces, use TRIM before VALUE to avoid errors.
VALUE returns #VALUE! error if text is not a valid number.
VALUE can convert dates and times stored as text into numeric date/time values.