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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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