Spreadsheet Practice

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 to B7
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

  1. A2"1.2K"

    The value in A2.

  2. RIGHT(A2)"K"

    RIGHT: Characters from the end of text.

    • textA2"1.2K"
  3. RIGHT(A2)="K"TRUE

    The = operator tests whether the two sides are equal.

  4. LEN(A2)4

    LEN: Number of characters.

    • textA2"1.2K"
  5. LEN(A2)-13

    The - operator subtracts.

  6. LEFT(A2,LEN(A2)-1)"1.2"

    LEFT: Characters from the start of text.

    • textA2"1.2K"
    • num_charsLEN(A2)-13
  7. LEFT(A2,LEN(A2)-1)*10001200

    The * operator multiplies.

  8. RIGHT(A2)"K"

    RIGHT: Characters from the end of text.

    • textA2"1.2K"
  9. RIGHT(A2)="M"FALSE

    The = operator tests whether the two sides are equal.

  10. LEN(A2)4

    LEN: Number of characters.

    • textA2"1.2K"
  11. LEN(A2)-13

    The - operator subtracts.

  12. LEFT(A2,LEN(A2)-1)"1.2"

    LEFT: Characters from the start of text.

    • textA2"1.2K"
    • num_charsLEN(A2)-13
  13. LEFT(A2,LEN(A2)-1)*10000001200000not used

    The * operator multiplies.

  14. VALUE(A2)#VALUE!

    VALUE: Converts text that looks like a number into a number.

    • textA2"1.2K"
  15. IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2))#VALUE!not used

    IF: Returns one value if a test is true, another if false.

    • logical_testRIGHT(A2)="M"FALSE
    • value_if_trueLEFT(A2,LEN(A2)-1)*10000001200000not used
    • value_if_falseVALUE(A2)#VALUE!
  16. IF(RIGHT(A2)="K",LEFT(A2,LEN(A2)-1)*1000,IF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2)))1200

    IF: Returns one value if a test is true, another if false.

    • logical_testRIGHT(A2)="K"TRUE
    • value_if_trueLEFT(A2,LEN(A2)-1)*10001200
    • value_if_falseIF(RIGHT(A2)="M",LEFT(A2,LEN(A2)-1)*1000000,VALUE(A2))#VALUE!not used

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.

FormulaResultWhen 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

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