+ Reply to Thread
Results 1 to 7 of 7

Formatting Numbers after decimals

  1. #1
    Registered User
    Join Date
    03-18-2018
    Location
    San Francisco
    MS-Off Ver
    MS 2013
    Posts
    73

    Formatting Numbers after decimals

    Hi folks,

    I’m having a bit of trouble formatting a cell. File attached. If you were to look at Cell CF100, it doesn’t look like anything or the way I want it to show like that in the cell above it. I tried the formula in another cell, in Cell CF108 and it gives me way to many numbers after the decimal where all I want is to display the number as a whole, i.e 56 since we round up. Now, I tried formatting the cell to do that however it’s not working. So I don’t know why in Cell CF99 it is ok however the 2 cells below it are not formatted or displayed in the same way even though all I did was copy formula’s.

    Cell CF100 is referenced to Cells BS122:BX128 but I cleared it a made new in Cells BM130:BR135. There, you can see that certain cells shows the decimals however, when I format it to only show a whole number i.e what was 68.625 is now 69, Cell CF100 still shows many numbers after the decimal, again, even though I formatted the cell as well.

    Any idea what I’m doing wrong?? I thought of using the TRUNC function but wasn’t sure if that would fix the problem.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,872

    Re: Formatting Numbers after decimals

    The formula in CF100 and CF108 returns a text string ("FLEX number °C"). Number formatting has no effect on text strings.

    When you want a formula to incorporate a number (especially a calculated double precision floating point number), you need to use the TEXT() or ROUND() or other function to limit the text output to the number of digits that you want to see. For example, you could replace the current output with something like "FLEX "&TEXT(BO135,"0")&" °C"

    Does that help?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,370

    Re: Formatting Numbers after decimals

    A similar problem appeared on this forum a few days ago and the only "solution" was use TEXT to format the number ..

    =IFERROR(IF(OR(BO135<=CF103,BO135<=CFM!E13,CFM!E15=Corrections!I12,CFM!E18="TOGA"),"TOGA","FLEX "&TEXT(BO135,"0.00") &" °C"),)

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,370

    Re: Formatting Numbers after decimals

    @MrShorty

    The formula in CF99 is formatted as NUMBER and works as if was only number. As I said in my previous post, this problem was recorded a few days ago with identical results i.e, worked in one case but not in what are identical circumstances.

  5. #5
    Registered User
    Join Date
    03-18-2018
    Location
    San Francisco
    MS-Off Ver
    MS 2013
    Posts
    73

    Re: Formatting Numbers after decimals

    Quote Originally Posted by MrShorty View Post
    "FLEX "&TEXT(BO135,"0")&" °C"

    Does that help?
    Thanks for the help. I tried that and didn't work however, below seemed to work. Just needed to add the ),) in the end as JohnTopley suggested.

    TEXT(BO135,"0.00") &" °C"),)

  6. #6
    Registered User
    Join Date
    03-18-2018
    Location
    San Francisco
    MS-Off Ver
    MS 2013
    Posts
    73

    Re: Formatting Numbers after decimals

    Quote Originally Posted by JohnTopley View Post
    A similar problem appeared on this forum a few days ago and the only "solution" was use TEXT to format the number ..

    =IFERROR(IF(OR(BO135<=CF103,BO135<=CFM!E13,CFM!E15=Corrections!I12,CFM!E18="TOGA"),"TOGA","FLEX "&TEXT(BO135,"0.00") &" °C"),)
    Thank you John. It works now. I did try to search in the forum for a solution, perhaps I didn't use the right keywords. It just seems strange to me that in Cell CF99, I didn't have to input the TEXT function in the formula and still got the result as displayed yet in Cells CF100 & CF101, it didn't display the result as in Cell CF99. Even if you were to look in Cells CF13:CF15, the formula there doesn't have the TEXT function and results displayed as it should. Perhaps like you said if I understood correctly, worked in one case but not in what are identical.

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,872

    Re: Formatting Numbers after decimals

    The difference I see between CF99 and CF100 is the number it's pulling in. CF99 is pulling the number from BU100, which is exactly 59 (69.00000000-10.0000000-0). CF100 is pulling the number from BO135, which is 58.962... (68.962...-10.000-0). This then traces back to the different results in BU95 (which is the same as the value in CF105) and BO131 (which is the result of the FORECAST() function which is less than 69). I'm not going to reverse engineer the entire spreadsheet, but it appears that sometimes in these cells you are returning the exact value of 69 from CF105 and other times you are returning the value from a FORECAST() function. Without some constraint on the FORECAST() output to force it to be an integer, the FORECAST() function will return non-integer values.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sum of numbers with decimals.
    By anuselesscharacter in forum Excel General
    Replies: 5
    Last Post: 09-25-2020, 02:30 PM
  2. Sum of numbers with decimals.
    By anuselesscharacter in forum Excel General
    Replies: 1
    Last Post: 09-25-2020, 01:03 AM
  3. Replies: 4
    Last Post: 09-25-2019, 08:26 PM
  4. Formula to identify between whole numbers and numbers with decimals
    By Jonor55 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-28-2019, 10:14 AM
  5. [SOLVED] Convert all numbers stored as text or custom formatted to numbers &no decimals - 40 sheets
    By synses in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 01:46 AM
  6. About decimals numbers
    By RazBoss in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2009, 02:39 PM
  7. Numbers have too many decimals
    By stev49 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-18-2009, 07:01 AM

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