Conditional counts in array

jlk3

New Member
Joined
Sep 26, 2012
Messages
7
How to tally counts in an table as below across 2 columns, please. Simplified worksheet below.

For each 'payor', I want to be able to count the number of each 'order type'.

Something to the effect of: COUNTIF (payor="GR" AND order_type="P")

There are only 2 payor values and 2 order type values, so I'm thinking I would create 4 formulas which specify the 4 possible combos.

Any help would be appreciated. Thank you!

[TABLE="width: 200, align: left"]
<tbody>[TR]
[TD]Order_type[/TD]
[TD]Payor[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]GR[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]GR[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]GR[/TD]
[/TR]
[TR]
[TD]s[/TD]
[TD]GR[/TD]
[/TR]
[TR]
[TD]s[/TD]
[TD]GR[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]JK[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]JK[/TD]
[/TR]
[TR]
[TD]s[/TD]
[TD]JK[/TD]
[/TR]
[TR]
[TD]s[/TD]
[TD]JK[/TD]
[/TR]
[TR]
[TD]s[/TD]
[TD]JK[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Meaning how many rows in the worksheet? It is not very large. I need to do in two worksheets. One sheet has about 200 rows. The other about 500.
 
Upvote 0
Oh...

GP where order_type="P": 3
GP where order_type="S": 2
JK where order_type="P": 2
JK where order_type="P": 3

Is that what you mean?

Thank you.
 
Upvote 0
Yes! That did it. Thank you.

Just needed "=" signs in the formula. =COUNTIFS($I$7:$I215,"=P",$K$7:$K215,"=JK")

You've been super helpful. And super fast. Thank you very much.
 
Last edited:
Upvote 0
Yes! That did it. Thank you.

Just needed "=" signs in the formula. =COUNTIFS($I$7:$I215,"=P",$K$7:$K215,"=JK")

You've been super helpful. And super fast. Thank you very much.

You are welcome. By the way, when no relational operator is specified, Excel assumes the equalty operator, i.e. '=', per default.
 
Upvote 0
oh, good to know. thanks.

i gave that a try and it does work as you say.

i guess the problem i had was due to another error I had made then.

thanks again.
 
Upvote 0

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