Question : How do display number as KB, MB, or GB?

I have a column that is a list of numbers. The numbers are in Bytes. I would like to display them as either KB, MB, or GB depending on size.

Sample numbers are:
1176104854  (would be displayed as 1.09 GB)
739342040 (705 MB)
108700 (106 KB)

Can someone help me out with a formula?

Thank you.

Answer : How do display number as KB, MB, or GB?

You put two formulas in a single cell. Excel therefore treated it as a Boolean expression, hence the TRUE and FALSE results.

I modified your workbook to put formulas in two columns. I also modified the first formula to return answers in Bytes for the few small files.
=LOOKUP(1,J2/1024^{4,3,2,1,0},TEXT(J2/1024^{3,2,1,0},"[<10]#.00 ;# ") &{"GB","MB","KB","B"})

Brad
 
Your file with formulas in two columns
 
Random Solutions  
 
programming4us programming4us