Add and subtract but only include positive numbers

Pedrocollins

New Member
Joined
Dec 12, 2017
Messages
1
Morning all. Hopefully I can explain this in an understandable fashion!
I'm making a spreadsheet for ordering stock for a shop which arrives 2 days after being ordered, Basically I need to add the amount of stock I need over a 3 day period from the sales preditions i have and subtract from that total the amount of stock I have ordered to cover the predicted sales. This should leave me with the total I need to order in for my next order 2 days later

I am trying make a formula to add 4 separate rows and subtract 3 other rows from this total. Ie =b4+h4+j4+l4-k4-q4-n4 this works fine for me unless one of the rows has a negative figure in which causes the calculation to go array.

This happens as it's telling me I have too much stock and I need to order a negative amount

I would like negative figures to be shown but not to be added in the calculation. I've tried =sum and =sumif and =countif with ">0" but that seems to return an error code.
I'm very new to excel so hopefully there's an easy fix for this.
Thanks in advance to anyone who has any ideas
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi, which of those cells can be negative? If all of them then one possible option would be:

=MAX(0,B4)+MAX(0,H4)+MAX(0,J4)+MAX(0,L4)-MAX(0,K4)-MAX(0,Q4)-MAX(0,N4)
 
Upvote 0
(sumifs(b4,b4,">0")+sumifs(h4,h4,">0")+sumifs(j4,j4,">0")+sumifs(l4,l4,">0"))-(sumifs(k4,k4,">0")+sumifs(q4,q4,">0")+sumifs(n4,n4,">0"))
 
Upvote 0

Forum statistics

Threads
1,213,511
Messages
6,114,054
Members
448,543
Latest member
MartinLarkin

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