How to format a file size in Excel (B, KB, MB, GB)
February 2011.
=SI(A1>=1024*1024*1024; TEXTE(A1/(1024*1024*1024); "0")&" GiB";
SI(A1>=1024*1024; TEXTE((A1/(1024*1024)); "0")&" MiB";
SI(A1>=1024; TEXTE((A1/(1024)); "0")&" KiB";
TEXTE(A1; "0")&" B")))
In English:
=IF(A1>=1024*1024*1024; TEXT(A1/(1024*1024*1024); "0")&" GiB";
IF(A1>=1024*1024; TEXT((A1/(1024*1024)); "0")&" MiB";
IF(A1>=1024; TEXT((A1/(1024)); "0")&" KiB";
TEXT(A1; "0")&" B")))