+ Reply to Thread
Results 1 to 10 of 10

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
    Please Login or Register  to view this content.
    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 05:08 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    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 Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    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 Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    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...
    Where there is a will there are many ways.

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

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

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    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")

  7. #7
    Registered User
    Join Date
    12-24-2017
    Location
    Blueare, Islamabad
    MS-Off Ver
    2007
    Posts
    1

    Re: Number Format from Round Function within Concatenate

    Hi, I am using "Concatenate Function" with some numerical values. I have used "Text Function" for thousand separator. But it rounds off the figures automatically. here is the formula I am using

    =CONCATENATE("Price of one piece is PKR ", TEXT($F$10, "0,0"))
    it displays the results as "price of one piece is PKT 72,999"
    but I need to include all the decimal numbers with rounding. as 72,998.786.
    please suggest.

  8. #8
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Number Format from Round Function within Concatenate

    Quote Originally Posted by Haris Zahid View Post
    I have used "Text Function" for thousand separator. But it rounds off the figures automatically. here is the formula I am using
    =CONCATENATE("Price of one piece is PKR ", TEXT($F$10, "0,0"))
    it displays the results as "price of one piece is PKT 72,999"
    but I need to include all the decimal numbers with rounding. as 72,998.786.
    The format string for the TEXT function is the same as the one you would use for the Custom cell format.

    If you wanted the number with comma thousands separator and 2 decimal places, you would use:

    ="Price is PKR " & TEXT(F10,"#,##0.00")

    However, I am confused when you say that you "need to include all the decimal numbers with rounding".

    How would you like 72,998.786 to appear: 72,998.79 or 72,998.786?

    If the latter, there is no format that truly says "all decimal places". The following might work for you:

    ="Price is PKR " & TEXT(F10,"#,##0.00#############")

    That displays a minimum of 2 decimal places and up to 15 decimal places. Note that Excel formats only the first 15 significant digits (rounded).
    Last edited by joeu2004; 12-24-2017 at 08:03 PM. Reason: minor

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Number Format from Round Function within Concatenate

    Haris Zahid you are hijacking!.
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

  10. #10
    Registered User
    Join Date
    07-23-2020
    Location
    United Arab Emirates
    MS-Off Ver
    2019
    Posts
    1

    Re: Number Format from Round Function within Concatenate

    Quote Originally Posted by tigeravatar View Post
    zeze,

    Give this a try:
    =TEXT(ROUND(2.999,2),"0.00")&"-"&TEXT(ROUND(4.354,2),"0.00")
    you desreve a kiss on your cheek..thanks a lot bro!

+ 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.6.0 RC 1