+ Reply to Thread
Results 1 to 6 of 6

Thread: Number Format from Round Function within Concatenate

  1. #1
    Registered User
    Join Date
    12-02-2011
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Number Format from Round Function within Concatenate

    I'm using a round function within a concatenate function. I am rounding to 2 decimal places, but if the result has trailing zeroes, the round function will delete them. I'd like for it to always display two decimal places.

    For example, if I have numbers 2.999 and 4.354 and I want a cell that displays "3.00-4.35" so I use the formula
    =concatenate(round(2.999,2),"-",round(4.354,2))
    But this displays "3-4.35" instead.

    I can't use the "Format Cells" option, because the cell is no longer in number format. Trying a "custom" format like "#.##-#.##" does not work. I also tried the "Set Precision as Displayed" option, but it did nothing.

    Is there any way I can force Excel to display the trailing zeroes when my numbers are calculated by functions?

    Thanks!
    Last edited by zeze; 12-05-2011 at 04:08 PM.

  2. #2
    Valued Forum Contributor tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2003 - 2007
    Posts
    2,352

    Re: Number Format from Round Function within Concatenate

    zeze,

    Give this a try:
    =TEXT(ROUND(2.999,2),"0.00")&"-"&TEXT(ROUND(4.354,2),"0.00")
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-02-2011
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Number Format from Round Function within Concatenate

    Perfect! Thank you.

  4. #4
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057

    Re: Number Format from Round Function within Concatenate

    You can also use FIXED function to set the number of decimal places - it defaults to 2 so if you don't specify that's what you get.....

    =FIXED(2.999)&"-"&FIXED(4.354)
    Audere est facere

  5. #5
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Number Format from Round Function within Concatenate

    I just recently saw a user using that same FIXED function... and thought why not use it instead of TEXT for these situations... coincidental...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057

    Re: Number Format from Round Function within Concatenate

    It's a good alternative to know.......

    .....of course if you use TEXT then ROUND isn't really required, this should be sufficient

    =TEXT(2.999,"0.00")&"-"&TEXT(4.354,"0.00")
    Audere est facere

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0