ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting rid of all negative numbers on a worksheet (https://www.excelbanter.com/excel-programming/287395-getting-rid-all-negative-numbers-worksheet.html)

abxy

Getting rid of all negative numbers on a worksheet
 
Ok, for the workbook i'm building, I need all numbers equal to or less
than 0 to *not* be displayed. Instead I want the cells to be left blank
or display: -- (i'd prefer if the cells were blank though).

The real problem is that I have a range of cells that have the formula
=DAYS360 in them. That formula counts the days between two dates on the
worksheet, but when one date is entered and the other isn't, the cell
displays a huge negative number( becuase of the dept. i work in, i
never know the second date until sometime later, but the sheet still
has to be printed up in the meantime). I've tried everything I could
think of to fix it or get around this problem, but nothing quite works,
then, I realized "well, if I could just get the worksheet to display a
blank cell anytime a cell value is 0 or less, then the problem wouldn't
exist"

thanks


---
Message posted from http://www.ExcelForum.com/


Chris Leonard

Getting rid of all negative numbers on a worksheet
 
Use an IF statement in your worksheet

=if(mycalc <0, "", mycalc)

HTH

Chris



Ron Rosenfeld[_3_]

Getting rid of all negative numbers on a worksheet
 
On Fri, 9 Jan 2004 14:07:01 -0600, abxy
wrote:

Ok, for the workbook i'm building, I need all numbers equal to or less
than 0 to *not* be displayed. Instead I want the cells to be left blank
or display: -- (i'd prefer if the cells were blank though).


Use a custom format:

One that would work would be "0.00;;"

The first argument is for positive numbers. The second is for negative numbers
and the third for zero's. Since there is nothing there, those values will not
be displayed.

Since you posted in a programming group, the VBA method would be


rng.NumberFormat = "0.00;;"


--ron


All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com