Making cell 0 if less than 0

ardykav

Board Regular
Joined
Oct 18, 2015
Messages
172
Office Version
  1. 365
Platform
  1. Windows
Hi and Happy new Year to you all,

Would just like to know how what i need to add to a formula so that if the result is less than 0 it returns a 0 value?

Currently i have the following:

=IF(A4<>"New Car","N/A",IF(AND(A4="New Car",U4<>"Sold"),($AE$1-$M4),IF(U4="Sold","")))
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi, just replace ($AE$1-$M4) by MAX(0,$AE$1-$M4)
Happy New Year to you too!
 
Upvote 0
try
Code:
=IF(A4<>"New Car","N/A",IF(AND(A4="New Car",U4<>"Sold"),IF(U4="Sold","",IF($AE$1-$M4<0,0,$AE$1-$M4))))
 
Upvote 0
For future reference...

You do not need to include something you already checked for in the nested if. For example:

You had

=IF(A4<>"New Car","N/A",IF(AND(A4="New Car",U4<>"Sold"),........etc

Inside the first if we checked if A4 is <> "New Car" in the Else (or Value if False) section you only need to check for U4 and "Sold"
If the formula has gotten that far it means that A4 <> "New Car" is false, and therefore A4 = "New Car" No need to check A4 with the AND statement
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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