View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] danielpops@gmail.com is offline
external usenet poster
 
Posts: 1
Default Convert bytes to kilobytes or megabytes?

On Friday, September 11, 2009 at 1:16:02 PM UTC-7, Toney wrote:
Thanks for your help. Your reply was just a bit more spot on with the using
the 1024 byte/k. Between the two answers I figured out how to do this.

Thanks again

Toney


Sorry for the 9 year old thread resurrection, but here is an expansion that covers through petabytes in case anyone finds it useful :)


=IF(A5<2^10,A5&" bytes",IF(A5<2^20,ROUND (INT(A5/2^10),-1)&"kb",IF(A5<2^30,ROUND (INT(A5/2^30),-1)&"mb",IF(A5<2^40,ROUND (INT(A5/2^30),-1)&"gb",ROUND(INT(A5/2^40),1)&" tb"))))