+ Reply to Thread
Results 1 to 12 of 12

Formatting multiple numbers in a single cell

  1. #1
    Registered User
    Join Date
    03-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Formatting multiple numbers in a single cell

    I have two numbers in a single cell seperated by a dash. Is there a way to format them so they display as currency? It may be that sometimes the cell only displays one number.

    Thanks in advance.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Formatting multiple numbers in a single cell

    Hello Terghan ,

    Can you provide a few examples of numbers in this format?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010 & 2013
    Posts
    308

    Re: Formatting multiple numbers in a single cell

    Hi there

    I don't think there's any way using normal Excel (although I am forever suprised by the things people come up with around here!)

    I think you will need a User Defined Function (UDF):
    Please Login or Register  to view this content.
    This one has the following variables:
    strFormat - format of the numbers. e.g. "$0,0.00"
    Val1 - first value. e.g. 2000
    Optional strSeparator. If this is present, it will decide it must format a range. e.g. " - "
    Optional Val2. e.g. 3000.

    You need to put this in to a module in your spreadsheet.

    Alternatively, create it using built in Excel functions:
    Please Login or Register  to view this content.
    Best regards, Rob.
    Last edited by rscsmith; 04-18-2012 at 06:37 PM.

  4. #4
    Registered User
    Join Date
    03-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: Formatting multiple numbers in a single cell

    Just so no one thinks I'm putting them off, I will further address this issue tomorrow with examples. Rob, I will also give your solutions a try, although they seem potentially more complex than necessary (I hope).

    Hopefully my examples will make things a little clearer tomorrow.

    Thanks!

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Formatting multiple numbers in a single cell

    You can likely do it with a pair of TEXT() functions - depends on your samples.

  6. #6
    Registered User
    Join Date
    03-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: Formatting multiple numbers in a single cell

    Alright, sorry for the delay. Here is what I'm looking at. This cell has a formula that calls for a number or numbers from a different cell, it displays the numbers like this:

    1.17 - 1.20

    I would like for them to be formatted to look like this:

    $1.17 - $1.20

  7. #7
    Registered User
    Join Date
    03-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: Formatting multiple numbers in a single cell

    Added bonus, here's one of the formulas that calls for information from a seperate cell.

    Please Login or Register  to view this content.
    Last edited by Terghan; 04-19-2012 at 04:04 PM.

  8. #8
    Registered User
    Join Date
    03-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: Formatting multiple numbers in a single cell

    Also, same issue but with percentages in a different cell.

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Formatting multiple numbers in a single cell

    No guarantees - try this for the currency result

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: Formatting multiple numbers in a single cell

    Success! And I see what you did there, so I'm going to begin altering the rest of my formulas, to fix this issue. What would I replace $0.00 with for percentages? 0%?

    Thanks!

  11. #11
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Formatting multiple numbers in a single cell

    Try "0.00%" but you may have to divide the first argument by 100 if the results are out of whack.

    Like so: TEXT((blahblahblah)/100,"0.00%")

  12. #12
    Registered User
    Join Date
    03-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2007/2010
    Posts
    39

    Re: Formatting multiple numbers in a single cell

    Fantastic. Thanks for the help!

+ 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