+ Reply to Thread
Results 1 to 5 of 5

Keep Trailing Zeros if in a Formula Result

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    23

    Keep Trailing Zeros if in a Formula Result

    Hi, new to the forum but i have a formula question. I'm attempting to create a spreadsheet to calculate various things at my work, however I'm running into a problem that I can't solve. In one cell, I have a formula that returns an value to two significant figures. The number of decimal points that this value has is then used at various points throughout the sheet to truncate/round/etc. However, if the first value has a trailing zero as the second significant figure (ex. 0.20), that trailing zero is dropped. This creates problems since downstream calculations are then truncating to an incorrect number of decimal points. Does anyone have any suggestions for how to retain this trailing zero IF the formula results in one?
    Thanks in advance

    K
    Last edited by ks26; 01-10-2014 at 08:27 AM. Reason: SOLVED

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Keep Trailing Zeros if in a Formula Result

    For display, simply format the cell to number> 2 decimals
    I'm not sure how you are using this value in other cells. You can also use conditional formatting to adjust number formatting depending on some criteria but your question is too vague for me to give specifics. Upload a spreadsheet (Go Advanced> Manage Attachments)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  3. #3
    Registered User
    Join Date
    01-09-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Keep Trailing Zeros if in a Formula Result

    Thanks for the quick response ChemistB!
    I can't really send you the spreadsheet (confidentiality issues) so I'll try and elaborate here. I'm attempting to create a spreadsheet to automate the calcuation of two properties (we'll call them A and B) that will be reported. Property A needs to be reported to a maximum of two significant figures (which is currently calculating correctly), however, they will not always have two decimal places. For example: 0.036, 0.040 and 5.2 are all valid responses. For that reason, formatting the cell to a certain number of decimal places will not work. Property B is then truncated to the number of decimal places of Property A, so if a trailing zero is being dropped off of Property A, Property B will be incorrectly truncated. Here's an example: the result for Property A is 0.195, the calculation for two significant figures should result in 0.20 (not 0.2), that way Property B can truncate to the hundreths and not the tenths.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Keep Trailing Zeros if in a Formula Result

    Okay, here's an attached example
    At the top, I have how I think you want things. In A9:A12, I used Conditional formatting to modify the visual output.
    Can you make corrections to that to explain better what you are trying to do?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-09-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Keep Trailing Zeros if in a Formula Result

    yea that is the general idea of how i want the sheet to calculate, that worked great thank you!

+ 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] Add Trailing Zeros
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-07-2012, 01:42 AM
  2. Replies: 5
    Last Post: 04-09-2012, 02:28 PM
  3. Replies: 2
    Last Post: 10-03-2010, 04:26 PM
  4. trailing zeros in formula bar for numeric cell
    By rmagers in forum Excel General
    Replies: 4
    Last Post: 01-25-2010, 06:38 PM
  5. Formula/formatting to omit trailing zeros
    By Robin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-22-2006, 02:35 AM

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