View Single Post
  #3   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

I think it's impossible to format the cell in such a way, but formula below
calculates entered value in desired format in additional column (the result
will be a text string of course - in any calculations you have to use data
in original column). For number in cell A1 the formula will be

=A1/CHOOSE(MATCH(A1;{0;500;500000;500000000;5000000000 00};1);1;1000;1000000;
1000000000;1000000000000) & " " &
CHOOSE(MATCH(A1;{0;500;500000;500000000;5000000000 00};1);"";"k";"M";"G";"T")
& "B"

Numbers in array part (figural brackets) of MATCH function determine levels,
where scale will change. In my formula it's 0.5 of next-level measuring
unit - you can change those numbers according your needs.

Probably you have to replace semicolons in formula with commas too.


Arvi Laanemets


"JustSomeGuy" wrote in message
...
I have a number which is the size of a file on disk.
Depending on the size of the number I want to display it as either
1.5KB, or 2.0MB or .75GB or .5TB

However I want to be able to add up all the numbers in that column as

normal
numbers and also format it the same way.

How do I do this.... I do know VB very well...

Brian.