Multiple Criteria

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
Hi,

I have the following table:

Book1
BCDEFGHIJKLMNOPQRSTUVWXYZ
2Table 1Table 3Table 4Table 5
3NameID NoPolicyBranchDateNameBranchID CardJanFebMarAprPayment TypeJanFebMarAprBranchJanFebMarApr
4Amy55487PRM55877Dallas1/1/2022Amy554870PremiumDallas
5Bryan66678NB44785New York2/2/2022Bryan66678LoanNew York
6John45487LOA55547Chicago3/2/2022John45487New BusinessChicago
7Javier25568PRM5544Seattle4/4/2022Javier25568Seattle
8Javier45464NB446558Boston1/1/2022JavierBoston
9
10Table 2
11CodeDescription
12PRMPremium
13LOALoan
14NBNew Business
Sheet1
Cell Formulas
RangeFormula
K4K4=COUNTIFS(B4:B8,H4,F4:F8,K3)
V4:V8V4=UNIQUE(E4:E8)
J4:J7J4=XLOOKUP(H4,$B$4:$B$8,$C$4:$C$8)
Dynamic array formulas.



1) Table 1 is the raw data
2) Table 2 is the code to identify the payment description. Example: In Table 1, the column for Policy shows that there is an abbreviation infron of the policy no. This identifies the payment type.
3 Table 3- I am trying to summarize based on the columns. For the name column, I tried using Unique but its not accurate because Javier has sales in both Seattle and Boston. In addition I am not sure how to populate the branch and the count of policies by month
4) Table 4- I am trying to summarize based on the columns. Payment type is derived from the codes in Table 2. This is the abbreviation used in the policies for Table 1. Example PRM0001 means Premium. I am not sure how to derive the count based on the data in Table 1.
5) Table 5 - I am trying to summarize based on the columns. I tried using Countifs but I am not sure how to specify the count by month based on the date in Table 1.

Appreciate any help.
 
Hi Alex,

Thank you so much for your solution. It shows the correct result.

One question. The raw or the source data is in Table 1. Is there any reason why the formula in Table 5 is also referencing Table 3?
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
One question. The raw or the source data is in Table 1. Is there any reason why the formula in Table 5 is also referencing Table 3?
Thats a great catch. The reference to column J should be to V.
So the formula in W4 should be the below then copy or fill down and then across.

Excel Formula:
=COUNTIFS($E$4:$E$8,$V4,$F$4:$F$8,"<=" & EOMONTH(DATEVALUE("01-"&W$3&"2022"),0),$F$4:$F$8,">" & EOMONTH(DATEVALUE("01-"&W$3&"2022"),-1))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,361
Messages
6,124,500
Members
449,166
Latest member
hokjock

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