Display a zero if formula results in a negative number

Qazxswe

New Member
Joined
May 28, 2012
Messages
36
I have a formula that displays calculates a number:
Excel Formula:
=(D34-((D34/36)*F34))*C34

I'm trying to come up with a way which means that if the value is a negative number it changes it to zero (or perhaps errors)

If I use custom data validation on the result cell, I can't enter a negative number, but if the formala calculation results in a negative, the DV seems to be ignored. I've also tried a =MAX function with no success. What is the best way to achieve this? To confirm; I want the number to be a zero, not just display as zero, so if I was to sum the results it is not included in the calculation at all.

Any suggestions
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You said you have tried MAX already. what was it?

Anyway, try:

=MAX(0,(D34-((D34/36)*F34))*C34)

Does it work?
 
Upvote 0
Solution
A minor thing, but you have a couple of sets of parentheses that don't actually do anything. This should do the same thing.

=MAX(0,(D34-D34/36*F34)*C34)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top