+ Reply to Thread
Results 1 to 6 of 6

Format a cell that contains a 0 or a number that would round to 0 to apply a dash (-)

  1. #1
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Format a cell that contains a 0 or a number that would round to 0 to apply a dash (-)

    I want to format a cell or an entire column to have a dash in it when the cell contains a zero how ever I want it to apply the dash (-) when it rounds because I am not showing decimals. current if I put 0.05 in a cell it rounds it down to zero and in that cell it shows "0" and if I put a -0.05 in that cell it appears as a negative zero like so .(0) I have attached a couple of screen shots the one on the right is what it looks like when a number like 0.05 is entered and the one on the left is what I would like it to look like if I entered that same number in. I am think custom formatting would work which is what I currently use and it works so long as the amount I put in is .50 or larger or -.50 or smaller.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Format a cell that contains a 0 or a number that would round to 0 to apply a dash (-)

    You don't like making it easy for us, do you? jpgs are of little use. it would be much easier if you had posted an actual sheet.

    However, try:

    =if(abs(your equation used to calculate variance)<1,"-",your equation used to calculate variance)

    If that doesn't work, then please attach an ACTUAL Excel sheet.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: Format a cell that contains a 0 or a number that would round to 0 to apply a dash (-)

    Sorry, I have attached an actual copy. The formula kept giving me an error. What I previously did is format the column as currency then remove the decimals and the dollars signs and then I go into custom and slect the type shown in the screen shot I have attached and following the #,##0_);(#,##0) I put a ;- This then formats the cell to produce a - in the place of a zero so long as the zero exactly zero and and not 0.01 or or more or -0.01 or less
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Format a cell that contains a 0 or a number that would round to 0 to apply a dash (-)

    Mmm. Actually your sheet isn't much use either, as it contains no formulae, just links to another sheet that you haven't posted...

    However,

    Take a look at the first three rows. On the sheet where the variance is ACTUALLY CALCULATED, use this formula to calculate the variance: =IF(ABS(F8-E8)<1,"-",F8-E8) adapted for whatever calculation & ranges you are using. I've expanded the number of decimal places in columns E & F so you can see that it works!!
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: Format a cell that contains a 0 or a number that would round to 0 to apply a dash (-)

    Fantastic! this works great thank you!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Format a cell that contains a 0 or a number that would round to 0 to apply a dash (-)

    Woo Hoo!!! can you mark the thread as solved and (preferably) click the Add Reputation button at the foot of this post?

+ 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. Number Format from Round Function within Concatenate
    By zeze in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-23-2020, 03:41 AM
  2. [SOLVED] Round Number Down by Decimal Places Using Format
    By jaclrsen in forum Excel General
    Replies: 8
    Last Post: 10-19-2012, 06:02 AM
  3. Replies: 11
    Last Post: 08-16-2012, 09:49 AM
  4. [SOLVED] How to format a cell to reflect a NIC's MAC Address ? (put in dash
    By jfen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-17-2006, 04:40 PM
  5. Can I format a cell to round a number by 50 basis points (0.5)?
    By daveb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-18-2005, 09:05 PM

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