How to convert 1.2K and 3M text to numbers in Excel
Formula (Excel and Google Sheets)
=IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2)))Check the last character and multiply: =IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2))).
- Result on the example
- one result per row in
B2, filled down toB7 - Works in
- Excel 2021, 2024 and Microsoft 365
- Google Sheets
- Same formula
See it work
The formula is already in B2, filled down to B7. Change any input and the result updates, or edit the formula to experiment.
How it works
RIGHT reads the suffix. For K or M, LEFT drops it and the multiplication turns the rest into a number and scales it. Values without a suffix go through VALUE. The comparison ignores case, so "1.2k" works too.
=IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2)))Result1200
A2"1.2K"The value in A2.
RIGHT(A2)"K"RIGHT: Characters from the end of text.- text
A2"1.2K"
- text
RIGHT(A2)="K"TRUEThe = operator tests whether the two sides are equal.
LEN(A2)4LEN: Number of characters.- text
A2"1.2K"
- text
LEN(A2)-13The - operator subtracts.
LEFT(A2,LEN(A2)-1)"1.2"LEFT: Characters from the start of text.- text
A2"1.2K" - num_chars
LEN(A2)-13
- text
LEFT(A2,LEN(A2)-1)*10001200The * operator multiplies.
RIGHT(A2)"K"RIGHT: Characters from the end of text.- text
A2"1.2K"
- text
RIGHT(A2)="M"FALSEThe = operator tests whether the two sides are equal.
LEN(A2)4LEN: Number of characters.- text
A2"1.2K"
- text
LEN(A2)-13The - operator subtracts.
LEFT(A2,LEN(A2)-1)"1.2"LEFT: Characters from the start of text.- text
A2"1.2K" - num_chars
LEN(A2)-13
- text
LEFT(A2,LEN(A2)-1)*10000001200000not usedThe * operator multiplies.
VALUE(A2)#VALUE!VALUE: Converts text that looks like a number into a number.- text
A2"1.2K"
- text
IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2))#VALUE!not usedIF: Returns one value if a test is true, another if false.- logical_test
RIGHT(A2)="M"FALSE - value_if_true
LEFT(A2,LEN(A2)-1)*10000001200000not used - value_if_false
VALUE(A2)#VALUE!
- logical_test
IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2)))1200IF: Returns one value if a test is true, another if false.- logical_test
RIGHT(A2)="K"TRUE - value_if_true
LEFT(A2,LEN(A2)-1)*10001200 - value_if_false
IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2))#VALUE!not used
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2))). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =LET(u,RIGHT(A2),n,IF(ISNUMBER(--u),A2,LEFT(A2,LEN(A2)-1)),n*SWITCH(u,"K",1000,"M",1000000,1)) | 1,200, 3,000,000, 850… | Excel 365: LET names the suffix and the number part, and SWITCH picks the multiplier, which is easier to extend with B for billions. |
Common mistakes
- A space before the suffix ("1.2 K") leaves a trailing space in the number part. Remove spaces first with SUBSTITUTE.
- Billions ("1.1B") need another branch, or they return #VALUE!.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Convert 1.2K and 3M text to numbers
B2, convert the follower count to a real number: K means thousands, M means millions. Fill down to B7.Questions
How do I go the other way, from numbers to 1.2K labels?
Use TEXT with trailing commas: =TEXT(B2,"0.0,")&"K" for thousands.
Does this work in Google Sheets?
Yes, the formula works the same.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.