SumIf formula help

usnapoleon

Board Regular
Joined
May 22, 2014
Messages
110
Office Version
  1. 365
Platform
  1. Windows
Hello everyone
I have this existing formula:

=SUMIFS($N$21:$N$57,$H$21:$H$57,M4,$M$21:$M$57,N4)

It works perfect, adding up whatever is in column N. What if I wanted it to continue doing that but subtract what is in column O too?

There is a long and ugly way of just inputting another round of sumifs to it, for the subtraction of column O like this:

=SUMIFS($N$21:$N$57,$H$21:$H$57,M4,$M$21:$M$57,N4)-SUMIFS($O$21:$O$57,$H$21:$H$57,M4,$M$21:$M$57,N4)

Is there a prettier way to do this?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try
Excel Formula:
=SUM(FILTER($N$21:$N$57-$O$21:$O$57,($H$21:$H$57=M4)*($M$21:$M$57=N4)))
 
Upvote 0
Solution
Try
Excel Formula:
=SUM(FILTER($N$21:$N$57-$O$21:$O$57,($H$21:$H$57=M4)*($M$21:$M$57=N4)))
That works! I added the extra for an empty filter. Works perfect! I knew there was something less messy! Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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