Number Format

L

LoganStallworth

Is there a way I can format a number so that significant 0's and a
letter are conditional?

I currently use:

?0"g" ?0"s" ?0"c" - which formats like so:

100000 = 10g 00s 00c
100010 = 10g 00s 10c
1000 = 0g 10s 00c


What I wish to have is a code that formats like so:

101010 = 10g 10s 10c
10000 = 10s
10 = 10c
100010 = 10g 10c


Is this possible?
 
B

Bob Phillips

Try a format of

[>9999]0"g "00"s "00"c";[>99]00"s "00"c";0"c"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LoganStallworth"
 
L

LoganStallworth

That works very well. I appreciate it, but may I ask for one more
thing.

I now know that you can use ; and [] for something of an if/then
statement, but how do I do something that will not put 00c, but will
put 10c if there is something in the ten and ones place?
 
L

LoganStallworth

Also. Why is it that

[>9999]0"g "00"s "00"c";[>99]00"s" 00"c";[>0]#0"c";[Red]0"c"

is invalid?
 
Top