Add to this formula to say if the answer is less than 0 its Zero?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I have a fairly long formula that I use a lot in a sheet to calculate a value,

I'll not go into to much detail as to what it does as it works fine and I'm just wondering if there is a better solution to my edit to make minus numbers all "0"

so basicly the formula does some adding and taking away and give me the final value so 50+50+50 = 150 etc.
the problem is we can't have minus numbers,

so 50+50+50-200 =-50 but I want it to show as 0

the original formula is just:

"=if($C8="","",if(I_StockTake!$E$2=AV$5,I_StockTake!$E6,AU8)+IF(C_OrdersArrival!AV$1=1,C_OrdersArrival!AV8,0)-IF(C_ItemForecast!AV$1=1,C_ItemForecast!AV8,0))"

and to make it show 0 instead of minus I added another if with the formula repeated,

So:
=if($C8="","",If(if(I_StockTake!$E$2=AV$5,I_StockTake!$E6,AU8)+IF(C_OrdersArrival!AV$1=1,C_OrdersArrival!AV8,0)-IF(C_ItemForecast!AV$1=1,C_ItemForecast!AV8,0))<0,0,if(I_StockTake!$E$2=AV$5,I_StockTake!$E6,AU8)+IF(C_OrdersArrival!AV$1=1,C_OrdersArrival!AV8,0)-IF(C_ItemForecast!AV$1=1,C_ItemForecast!AV8,0)))

but this seams like a long way of doing it, is there a better way to add in if result is less than 0 use 0 ???

any ideas would be a help.


Thanks

Tony
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try this:
Code:
=IF($C8="","",MAX(0,IF(I_StockTake!$E$2=AV$5,I_StockTake!$E6,AU8)+IF(C_OrdersArrival!AV$1=1,C_OrdersArrival!AV8,0)-IF(C_ItemForecast!AV$1=1,C_ItemForecast!AV8,0)))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,362
Messages
6,171,642
Members
452,415
Latest member
mansoorali

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