Excel Calculated Value to Text Converter
Convert numeric Excel calculations into formatted text representations with precision
Convert numeric Excel calculations into formatted text representations with precision
Microsoft Excel is a powerful tool for numerical calculations, but sometimes you need to present those numbers as formatted text. Whether for reports, invoices, or data analysis, converting calculated values to text format is an essential skill for Excel users. This guide covers all methods, best practices, and advanced techniques for this conversion process.
The TEXT function is the most straightforward method:
=TEXT(value, format_text)
Examples:
=TEXT(1234.56, "$#,##0.00") → “$1,234.56”=TEXT(0.567, "0.0%") → “56.7%”=TEXT(DATE(2023,5,15), "mmmm d, yyyy") → “May 15, 2023”You can format cells to display numbers as text without changing the underlying value:
Note: This method changes how the number appears but keeps it as a numerical value for calculations.
Adding an apostrophe before a number forces Excel to treat it as text:
'12345 in a cellFor converting numbers to their word equivalents (e.g., “123” → “One Hundred Twenty-Three”), you’ll need VBA:
Alt+F11 to open VBA editorInsert > Module)=SpellNumber(A1) in your worksheet
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
MyNumber = Trim(Str(MyNumber))
DecimalPlace = InStr(MyNumber, ".")
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Dollars & Cents
End Function
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
If Mid(MyNumber, 1, 1) <> "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Result = ""
If Val(Left(TensText, 1)) = 1 Then
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit(Right(TensText, 1))
End If
GetTens = Result
End Function
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function
For large datasets, Power Query offers powerful text conversion options:
Data > Get & Transform > From Table/RangeTransform > Format > [choose format]Text.From([YourColumn])You can create custom number formats that display text based on conditions:
Ctrl+1[>=1000]$#,##0.00;[$-en-US]$#,##0.00 (currency format)#,##0.00 "units";-#,##0.00 "units" (with units)mmmm d, yyyy;@ (date or text)| Method | Best For | Limitations | Preserves Original Value | Requires VBA |
|---|---|---|---|---|
| TEXT function | Simple formatting needs | Limited to built-in formats | No (creates new text value) | No |
| Cell formatting | Visual display changes | Doesn’t change underlying value | Yes | No |
| Apostrophe prefix | Quick text conversion | Manual entry required | No | No |
| SpellNumber (VBA) | Number-to-words conversion | Requires macro-enabled workbook | No | Yes |
| Power Query | Large datasets | Steeper learning curve | Configurable | No |
| Custom formats | Conditional display | Complex syntax | Yes | No |
Convert currency values to standardized text formats:
=TEXT(1234567.89, "$#,##0.00") → “$1,234,567.89”=TEXT(1234567.89, "[$€-2]#,##0.00") → “€1.234.567,89” (Euro format)=TEXT(1234567.89, "\"Total: \"$#,##0.00") → “Total: $1,234,567.89”Convert dates and times to various text formats:
=TEXT(NOW(), "mmmm d, yyyy h:mm AM/PM") → “May 15, 2023 2:30 PM”=TEXT(NOW(), "ddd, mmm d") → “Mon, May 15”=TEXT(NOW(), "[h]:mm:ss") → “48:30:45” (elapsed time)Format very large or small numbers:
=TEXT(123456789, "0.00E+00") → “1.23E+08”=TEXT(0.00001234, "0.00E+00") → “1.23E-05”Combine numbers with text for labels:
=TEXT(A1, "0") & " widgets" → “123 widgets”="Order #" & TEXT(A1, "00000") → “Order #01234”=TEXT(A1, "$0.00") & " per unit" → “$12.34 per unit”Causes and Solutions:
Solutions:
Solutions:
=VALUE(A1)=A1*1Solutions:
Excel’s custom number formatting uses specific codes to control display:
| Format Code | Example | Result | Description |
|---|---|---|---|
# |
#.00 |
1234.56 → 1234.56 | Digit placeholder (shows significant digits) |
0 |
0000.00 |
123.4 → 0123.40 | Digit placeholder (shows leading/trailing zeros) |
, |
#,##0 |
1234567 → 1,234,567 | Thousand separator |
. |
#.00 |
12.345 → 12.35 | Decimal point |
% |
0.00% |
0.756 → 75.60% | Percentage (multiplies by 100) |
E+ E- |
0.00E+00 |
12345 → 1.23E+04 | Scientific notation |
$ € £ ¥ |
$#,##0.00 |
1234.56 → $1,234.56 | Currency symbols |
mm dd yy |
mmmm d, yyyy |
5/15/2023 → May 15, 2023 | Date formatting |
[Color] |
[Red]$#,##0.00 |
Negative → Red $1,234.56 | Conditional coloring |
[>=1000] |
[>=1000]$#,##0;[$-en-US]$#,##0 |
1500 → $1,500; 500 → $500 | Conditional formatting |
"text" |
#,##0 "units" |
1234 → 1,234 units | Literal text |
For repetitive tasks, VBA macros can automate number-to-text conversions:
' Macro to convert selected numbers to text with custom format
Sub ConvertToText()
Dim rng As Range
Dim cell As Range
Dim fmt As String
' Get format from user input
fmt = InputBox("Enter the format string (e.g., $#,##0.00):", "Format String", "0.00")
If fmt = "" Then Exit Sub
' Get selected range
On Error Resume Next
Set rng = Selection.SpecialCells(xlCellTypeConstants, xlNumbers)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "No numeric cells selected!", vbExclamation
Exit Sub
End If
' Convert each cell
Application.ScreenUpdating = False
For Each cell In rng
cell.NumberFormat = "@" ' Set to text format
cell.Value = WorksheetFunction.Text(cell.Value, fmt)
Next cell
Application.ScreenUpdating = True
MsgBox "Converted " & rng.Count & " cells to text format: " & fmt, vbInformation
End Sub
' Macro to convert numbers to words in English
Sub ConvertToWords()
Dim rng As Range
Dim cell As Range
' Check if SpellNumber function exists
On Error Resume Next
Dim test As Variant
test = Application.Run("SpellNumber", 123)
If Err.Number <> 0 Then
MsgBox "SpellNumber function not found. Please install it first.", vbExclamation
Exit Sub
End If
On Error GoTo 0
' Get selected range
On Error Resume Next
Set rng = Selection.SpecialCells(xlCellTypeConstants, xlNumbers)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "No numeric cells selected!", vbExclamation
Exit Sub
End If
' Convert each cell
Application.ScreenUpdating = False
For Each cell In rng
cell.NumberFormat = "@" ' Set to text format
cell.Value = Application.Run("SpellNumber", cell.Value)
Next cell
Application.ScreenUpdating = True
MsgBox "Converted " & rng.Count & " cells to word format", vbInformation
End Sub
To use these macros:
Alt+F11 to open VBA editorInsert > Module)Developer > Macros or assign to a buttonFinancial statements often require:
Example format: _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)
Research papers often require:
Example format: 0.00E+00 "m" (for meters)
Inventory systems often use:
Example format: 00000 (for 5-digit part numbers with leading zeros)
Medical records often require:
Example format: 0.00 "mg/dL" (for blood sugar levels)
When working with large datasets:
Microsoft continues to enhance Excel’s text handling capabilities:
To deepen your Excel text conversion skills:
Converting Excel calculated values to text is a fundamental skill that enhances your ability to present numerical data effectively. From simple formatting with the TEXT function to advanced VBA solutions for number-to-words conversion, Excel offers powerful tools for every need. By mastering these techniques, you can create professional reports, ensure data integrity, and meet various industry-specific requirements.
Remember to:
As you become more proficient with these techniques, you’ll discover even more creative ways to present your numerical data as text in Excel, making your spreadsheets more informative and professional.