ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula (https://www.excelbanter.com/excel-worksheet-functions/112226-formula.html)

Christine Haines

Formula
 
I am trying to input a formula that when I subtract the contents of one cell
from another if the sum is negative, I want a zero to show in the cell. If
the sum of the cell is a positive number then I want the sum to show in the
cell.

This is what I have tried =IF(G4-H4<=0,0). The only problem with it is
every time the sum of the cell comes up positive it gives me a false
statement. If the sum is positive I want to see that sum.

Toppers

Formula
 
=MAX(0,G4-H4)

"Christine Haines" wrote:

I am trying to input a formula that when I subtract the contents of one cell
from another if the sum is negative, I want a zero to show in the cell. If
the sum of the cell is a positive number then I want the sum to show in the
cell.

This is what I have tried =IF(G4-H4<=0,0). The only problem with it is
every time the sum of the cell comes up positive it gives me a false
statement. If the sum is positive I want to see that sum.


Gord Dibben

Formula
 
Need another argument to tell Excel what to do if value is not <= 0

=IF(G4-H4<=0,0,G4-H4)

Another method.........=MAX(0,G4-H4)


Gord Dibben MS Excel MVP


On Fri, 29 Sep 2006 11:06:02 -0700, Christine Haines <Christine
wrote:

I am trying to input a formula that when I subtract the contents of one cell
from another if the sum is negative, I want a zero to show in the cell. If
the sum of the cell is a positive number then I want the sum to show in the
cell.

This is what I have tried =IF(G4-H4<=0,0). The only problem with it is
every time the sum of the cell comes up positive it gives me a false
statement. If the sum is positive I want to see that sum.



Christine Haines

Formula
 
It worked! Thank you so much!!!!!

"Gord Dibben" wrote:

Need another argument to tell Excel what to do if value is not <= 0

=IF(G4-H4<=0,0,G4-H4)

Another method.........=MAX(0,G4-H4)


Gord Dibben MS Excel MVP


On Fri, 29 Sep 2006 11:06:02 -0700, Christine Haines <Christine
wrote:

I am trying to input a formula that when I subtract the contents of one cell
from another if the sum is negative, I want a zero to show in the cell. If
the sum of the cell is a positive number then I want the sum to show in the
cell.

This is what I have tried =IF(G4-H4<=0,0). The only problem with it is
every time the sum of the cell comes up positive it gives me a false
statement. If the sum is positive I want to see that sum.





All times are GMT +1. The time now is 05:17 PM.

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