ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to make a formula display results only if value is greater tha (https://www.excelbanter.com/excel-discussion-misc-queries/2592-how-make-formula-display-results-only-if-value-greater-tha.html)

superfooz74

How to make a formula display results only if value is greater tha
 
I am new to Excel formulas. I assume i need an IF statement but not sure on
correct syntax
=D2-B2 is what i have now, what can i add to it so that it only displays
values 0?

Frank Kabel

Hi
=IF(D2-B20,D2-B2,"")

"superfooz74" wrote:

I am new to Excel formulas. I assume i need an IF statement but not sure on
correct syntax
=D2-B2 is what i have now, what can i add to it so that it only displays
values 0?


Karl

=if(d2-b20,d2-b2,"")
"superfooz74" wrote in message
...
I am new to Excel formulas. I assume i need an IF statement but not sure

on
correct syntax
=D2-B2 is what i have now, what can i add to it so that it only displays
values 0?




superfooz74

Thank you for such a quick and accurate response.

"Frank Kabel" wrote:

Hi
=IF(D2-B20,D2-B2,"")

"superfooz74" wrote:

I am new to Excel formulas. I assume i need an IF statement but not sure on
correct syntax
=D2-B2 is what i have now, what can i add to it so that it only displays
values 0?


Frank Kabel

Hi
you're welcome :-)

"superfooz74" wrote:

Thank you for such a quick and accurate response.

"Frank Kabel" wrote:

Hi
=IF(D2-B20,D2-B2,"")

"superfooz74" wrote:

I am new to Excel formulas. I assume i need an IF statement but not sure on
correct syntax
=D2-B2 is what i have now, what can i add to it so that it only displays
values 0?


Harald Staff

That depends on what you want to happen in the cell if D2 < B2.

Contain 0:
=MAX(D2-B2,0)

Contain empty string:
=IF(D2B2,D2-B2,"")

Contain negative number but hide it from view:
Menu Format Conditional formatting, criteria: value < 0 format: text color
same as background color.

Contain negative number but display zero:
Format Cells Number Custom number format 0;"0"
(or maybe it's a comma instead of a semicolon)

HTH. Best wishes Harald

"superfooz74" skrev i melding
...
I am new to Excel formulas. I assume i need an IF statement but not sure

on
correct syntax
=D2-B2 is what i have now, what can i add to it so that it only displays
values 0?





All times are GMT +1. The time now is 01:30 PM.

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