# How to convert 1.2K and 3M text to numbers in Excel

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))).

**Excel:** `=IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2)))` (Excel 2021, 2024 and Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Followers (text) | Number |
| 1.2K |  |
| 3M |  |
| 850 |  |
| 45.6K |  |
| 2.05M |  |
| 999 |  |

Formula in B2, filled to B7: `=IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2)))`

Result: 1,200; 3,000,000; 850; 45,600; 2,050,000; 999

## 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.

## Other ways

- `=LET(u,RIGHT(A2),n,IF(ISNUMBER(--u),A2,LEFT(A2,LEN(A2)-1)),n*SWITCH(u,"K",1000,"M",1000000,1))`: 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!.

## 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.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/convert-k-and-m-text-to-numbers
