SUMIF Array VBA

angel585858

New Member
Joined
Jun 18, 2020
Messages
5
Office Version
  1. 2013
Platform
  1. Windows
I am trying to sum columns based off of criteria in an adjacent column. The below formula works as long as I have less than 25 different criteria but won't sum anything more than that.
I have 42 different criteria that I need summed. Is there another way to do that?


=SUM(SUMIF($D$1:$D$800,{"M1","M2","M3","M4","M6","M7","M8","M9","MG","MJ","MN","MR","MW","PB","N7","N8","N9","R1","R2","R3","R4","R5","R6","RA"},I:I))
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I tried it on mine (Excel 365), and it works for over 25 criteria. I wonder if it has to do with the version you have. In any case, something like this should work on your version:

=SUM(SUMIF($D$1:$D$800,{"M1","M2","M3","M4","M6","M7","M8","M9","MG","MJ","MN","MR"},I:I))+SUM(SUMIF($D$1:$D$800,{"MW","PB","N7","N8","N9","R1","R2","R3","R4","R5","R6","RA","Rx","RZ"},I:I))
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

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