i am tryinng to convert the data present in an excel sheet, some in GB, MB, TB, KB. I want to convert everything into GB
here is the formula i use
=IF(ISERROR(FIND("GB",H2))=FALSE,VALUE(LEFT(H2,FIND("GB",H2)-1)*1),IF(ISERROR(FIND("TB",H2))=FALSE,VALUE(LEFT(H2,FIND("TB",H2)-1)*1024),VALUE(LEFT(H2,FIND("MB",H2)-1)/1024),VALUE(LEFT(H2,FIND("KB",H2)-1)/1048576)))
I get an error too many arguments
Use this array formula:
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of enter. If done correctly then excel will put
{}
around the formula.If your string always ends with the size then you can use this normal formula:
The IF for MB was missing:
Not that I encourage this kind of formula because it is so obtuse, but that is what was wrong with it. Also, it assumes that the last value HAS to be KB.
The
LEFT
part is to get the number before?B
, the*1024^
part is to convert it to GB based on the letter beforeB
, andROUND
is optional