using COUNTIFS to reference multiple cells for criteria for one range.

gchandler

New Member
Joined
May 21, 2015
Messages
49
The title of this post may be confusing so ill go into as much detail as possible.

Where i work, i constantly have to calculate revenue based off of claims. I run a report every month and i get many columns worth of data. This data is copied and pasted into its own tab in a workbook. I then reference that data with a COUNTIFS formula on another tab. this is the current formula i have constructed:

"=COUNTIFS(INDIRECT("'"&$E$2&" Claims'!A:A"),$A$26,INDIRECT("'"&$E$2&" Claims'!B:B"),$D$26,INDIRECT("'"&$E$2&" Claims'!D:D"),E27, INDIRECT("'"&$E$2&" Claims'!G:G"),I9)+COUNTIFS(INDIRECT("'"&$E$2&" Claims'!A:A"),$A$26,INDIRECT("'"&$E$2&" Claims'!B:B"),$D$26,INDIRECT("'"&$E$2&" Claims'!D:D"),E27, INDIRECT("'"&$E$2&" Claims'!G:G"),J9)+COUNTIFS(INDIRECT("'"&$E$2&" Claims'!A:A"),$A$26,INDIRECT("'"&$E$2&" Claims'!B:B"),$D$26,INDIRECT("'"&$E$2&" Claims'!D:D"),E27, INDIRECT("'"&$E$2&" Claims'!G:G"),K9)+COUNTIFS(INDIRECT("'"&$E$2&" Claims'!A:A"),$A$26,INDIRECT("'"&$E$2&" Claims'!B:B"),$D$26,INDIRECT("'"&$E$2&" Claims'!D:D"),E27, INDIRECT("'"&$E$2&" Claims'!G:G"),L9)"

In this formula, the tab im referencing every month is duplicated, and renamed according the current month and the new months data is imported monthly. thats why im using an INDIRECT function to reference the tab rather than a direct reference to one particular tab. cell $E$2 is where i input the month name and its joined with the word "Claims". in these tabs, Column A is where the Office name for every claim is listed, Column B is where the Line of the claim is listed (Workers Comp, Disability, etc). Column D is where the claim type is listed (Bodily Injury, Property Damage, etc). and column G:G is where the state of jurisdiction is located. This is where things get tricky. You can see in the formula that the cells I9, J9, K9, & L9 are referenced separately. ex: in the cell I9 is the letters CA. as you can see in this formula, for every state that i need to reference, i have to repeat the entire formula just to reference another additional State. Its important that i count certain states together because certain groups of state's claims are charged at different rates. Is there a way that i can reference these states all together in one formula rather than having to duplicate the formula over and over again and summing the results together?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try...

=SUMPRODUCT(COUNTIFS(INDIRECT("'"&$E$2&" Claims'!A:A"),$A$26,INDIRECT("'"&$E$2&" Claims'!B:B"),$D$26,INDIRECT("'"&$E$2&" Claims'!D:D"),E27, INDIRECT("'"&$E$2&" Claims'!G:G"),I9:L9))

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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