Sum Row with standard condition

Status
Not open for further replies.

ShafiqqAziz

New Member
Joined
Jan 9, 2018
Messages
6
Hello guys,

I need a help create a sum with 1 condition in multiple columns.

Here's an example:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Quantity 1[/TD]
[TD]Quantity 2[/TD]
[TD]Quantity 3[/TD]
[TD]Quantity 4[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]-1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Item 2[/TD]
[TD]0[/TD]
[TD]-1[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Item 3[/TD]
[TD]-2[/TD]
[TD]1[/TD]
[TD]-1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Item 4[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]-2[/TD]
[/TR]
</tbody>[/TABLE]

What i'm trying to do here, i want the sum to be separated between negative and positive.
E.g:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Quantity Negative[/TD]
[TD]Quantity Positive[/TD]
[/TR]
[TR]
[TD]Item 1[/TD]
[TD]-1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Item 2[/TD]
[TD]-1[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Item 3[/TD]
[TD]-3[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Item 4[/TD]
[TD]-2[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]

I've tried SUMPRODUCT((A2:A5=A2)*(B2:E5>0)*(B2:E5)) give me #VALUE ! error.
Tried all of this
1. https://www.extendoffice.com/docume...ultiple-columns-based-on-single-criteria.html
2. https://support.office.com/en-us/ar...nditions-e610ae0f-4d27-480c-9119-eb644f1e847e
3. https://www.extendoffice.com/documents/excel/4097-excel-sum-based-on-column-and-row-criteria.html

Can you guys help me out?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
for the negatives

=SUMIF(H2:K2,"<0",H2:K2)

for the positives

=SUMIF(H2:K2,">0",H2:K2)

where I have your item 1 quantity values in cells h2:k2
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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