Share via

leave cell blank if negative or zero

Anonymous
2013-10-02T19:08:30+00:00

Hi All

On my spreadsheet I'm subtracting two cells, in column W, to get the difference in column X

I don't want to see negative or zero in any of the cells that don't yet have a calculated value in column X.

=IF(W4-W3=0,"",W4-W3)   this would leave either a positive value or a blank in cell X4 

However, if there is NO value yet inputted in cell W5, then cell X5 will show as a negative value.

What would the formula be for cells X5 : X15  so that I don't see either the negative or a zero.

Am I clear?

Thanks for any help

fritzmom

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

12 answers

Sort by: Most helpful
  1. Anonymous
    2013-10-03T02:35:12+00:00

    Thanks very much for your replies.

    While doing some more searching I found a suggestion to someone else's similar question; add a '<' before the '=' . So the new formula would look like this:

     IF(W4-W3<=0,"",W4-W3)

    Seems to work on the spreadsheet I'm working on.  Haven't tried it on any other spreadsheets though. If anyone knows of a problem with doing a formula this way, please let me know.

    Thanks again

    fritzmom

    50+ people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-10-02T20:18:43+00:00

    Hello,

    there are two possible approaches to this: formula or formatting.

    A formula like this will work: =IF(COUNT(W3:W4)=2,W4-W3,"")

    Or with formatting, just use the formula =W4-W3 and format it with custom format

    0;;;

    Replace the 0 with 0.00 or any other number format you prefer. The formatting approach will hide all negative and zero values. If your data can produce negative values as the result of the formula, the formula approach may be better.

    20+ people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2013-10-02T19:25:27+00:00

    fritzmom wrote:

    =IF(W4-W3=0,"",W4-W3)   this would leave either a positive value or a blank in cell X4 

    However, if there is NO value yet inputted in cell W5, then cell X5 will show as a negative value.

    What would the formula be for cells X5 : X15  so that I don't see either the negative or a zero.

    Perhaps one of the following:

    =IF(OR(W4="",W3=""),"",W4-W3)

    or

    =IF(COUNT(W3,W4)<2,"",W4-W3)

    10+ people found this answer helpful.
    0 comments No comments
  4. Ashish Mathur 101.8K Reputation points Volunteer Moderator
    2017-04-14T22:57:25+00:00

    Hi,

    Try this

    =MAX(J3-K3;0)

    10+ people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2017-04-14T20:26:36+00:00

    Hello,

    replace the commas with semicolons. In most European countries, the computers are set up to use a semicolon between formula parameters.

    =if(J3-K3<=0;"";J3-K3)

    Watch what happens when you start typing a formula into a cell. Type

    =IF( 

    and take note of the symbols used in the tooltip.

    3 people found this answer helpful.
    0 comments No comments