+ Reply to Thread
Results 1 to 4 of 4

Number Format:What I wish to have is a code that formats l

  1. #1
    Registered User
    Join Date
    09-26-2005
    Posts
    6

    Number Format:What I wish to have is a code that formats l

    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?

  2. #2
    Bob Phillips
    Guest

    re: Number Format:What I wish to have is a code that formats l

    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"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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?
    >
    >
    > --
    > LoganStallworth
    > ------------------------------------------------------------------------
    > LoganStallworth's Profile:

    http://www.excelforum.com/member.php...o&userid=27561
    > View this thread: http://www.excelforum.com/showthread...hreadid=471534
    >




  3. #3
    Registered User
    Join Date
    09-26-2005
    Posts
    6
    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?

  4. #4
    Registered User
    Join Date
    09-26-2005
    Posts
    6
    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?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1