I have text data containing numbers with abbreviations for thousands (k) and millions (m). I want to convert these to numeric values. For example 1.2k to 1200 and 1.8m to 1800000. How can I do that?
3 Answers
You can use search to return the relative position in a string of the suffix. Then raise ten to that number time 3.
=LEFT(A1,LEN(A1)-1)*10^(SEARCH(RIGHT(A1),"kmbt")*3) To handle ones with out the suffix:
=IFERROR(LEFT(A1,LEN(A1)-1)*10^(SEARCH(RIGHT(A1),"kmbt")*3),A1) 5You can use this Formula to convert abbreviated data into Numbers:
Formula in Cell
C80& fill it down.=IFNA(LEFT(A80,LEN(A80)-1)*CHOOSE(MATCH(RIGHT(A80,1), {"K","M","B"},0),1000,1000000,1000000000),A80)
N.B.
MATCH(RIGHT(A80,1),{"K","M","B"},0), returns1forK,2forM&3forB.CHOOSEreturns1,000,1,000,000or1,000,000,000which is multiplied byLEFT(A80,LEN(A80)-1).LEFTremoves theKorM.
Adjust cell references in the Formula as needed.
2If the suffixes are real SI prefixes then you can use Excel's CONVERT() function to get the numeric values
=CONVERT(VALUE(LEFT(A2, LEN(A2) - 1)), RIGHT(A2, 1) & "m", "m") ▲ ▲ ▲ ▲ └─────────────┬────────────┘ └─────┬────┘ value value suffix/SI prefix The trick here is to convert km, Mm... to m, but of course instead of meter you can use any SI basic units. The thousand suffix must be k in lowercase for kilo, and the million suffix must be uppercase M for Mega

