COUNTIFS using same range (table), different criteria (columns)

darkbluecat

New Member
Joined
Jan 7, 2021
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Big table, with multiple columns, need to count no. of times it meets two criteria (two columns) in the table. Once I've got right formula I'll copy it across the new, simple table I've made: one criteria is x axis (headers), other criteria is y (first column). In the big table, i just need the number of times it meets both criteria (the name and code).

Can't attach file or give any more information as it's work stuff. Everything I try and do just returns zero, I've tried countif + countif and that doesn't work either. Also, array formulas won't cut it because there's so many name criterias and codes, all solutions I've found are to do with incorporating array formulas. In the simple table I'm making I just want the no. of times the specified cell (code in big table) appears under such and such name (name in big table in another column).

I reckon the solution has something to do with using maybe index and match functions outside the countif/s function, but I don't really know enough about these to figure it out myself.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi Darkbluecat
If maybe you could paste an example
From your description it sounds like a =Countifs() should work but maybe you haven't quite got it right?

Countifs(range,criteria,range,criteria)
Range should be single column, Criteria should be a single piece of information e.g. a cell or string like "Cat"

Pardon me if i'm assuming wrongly but I found your question slightly confusing

Thanks
Excel Fan
 
Upvote 0
Hi Darkbluecat
If maybe you could paste an example
From your description it sounds like a =Countifs() should work but maybe you haven't quite got it right?

Countifs(range,criteria,range,criteria)
Range should be single column, Criteria should be a single piece of information e.g. a cell or string like "Cat"

Pardon me if i'm assuming wrongly but I found your question slightly confusing

Thanks
Excel Fan
Yeah, that's what I'm doing, the column is the range and the cell header is the criteria, but it's two ranges in one table and different cell criterias
 
Upvote 0
Yes, so this is common for Countifs()

under Male and 25 the formula is =COUNTIFS($E:$E,L$1,$H:$H,$K2)
it uses criteria age and gender from 2 ranges
idfirst_namelast_nameemailgenderip_addressageAge/GenderMaleFemale
1​
RaymundLe Noirrlenoir0@java.comMale185.190.34.110
25​
25​
2​
3​
2​
LinnellBauslbaus1@vk.comFemale61.140.171.176
61​
26​
1​
3​
3​
BennieBrecknallbbrecknall2@ucoz.comFemale80.20.190.45
36​
4​
BalduinCranbcran3@tinypic.comMale208.214.65.175
65​
5​
NobieKlempsnklemps4@list-manage.comMale185.86.113.143
25​
6​
MintaLawtymlawty5@wikipedia.orgFemale178.93.114.31
68​
7​
MorgunMattheismmattheis6@bloomberg.comMale2.108.19.78
75​
8​
FlorindaO'Dowgainefodowgaine7@360.cnFemale69.176.51.97
42​
9​
BarbaraMincibminci8@paginegialle.itFemale145.221.30.213
51​
10​
GardnerCackroftgcockroft9@apache.orgMale203.161.101.51
26​
11​
SunnyHannabussshannabussa@cbslocal.comFemale188.202.200.139
42​
12​
CelestiaAbramowskycabramowskyb@home.plFemale161.146.186.244
26​
13​
DanielaHortopdhortopc@wp.comFemale142.235.65.156
25​
14​
MinerMatesmmatesd@dropbox.comMale48.139.220.69
42​
15​
RayIsacrisace@artisteer.comMale98.152.55.108
36​
16​
LuceLinskeyllinskeyf@hhs.govMale167.241.111.71
42​
17​
BrynnaJeanenetbjeanenetg@japanpost.jpFemale186.135.174.36
25​
18​
HeatherDeackeshdeackesh@imgur.comFemale21.185.193.192
26​
19​
AgneseWoodwardawoodwardi@timesonline.co.ukFemale210.7.185.141
25​
20​
EleanorArsnellearsnellj@cargocollective.comFemale187.194.185.152
26​
 
Upvote 0
Yes, so this is common for Countifs()

under Male and 25 the formula is =COUNTIFS($E:$E,L$1,$H:$H,$K2)
it uses criteria age and gender from 2 ranges
idfirst_namelast_nameemailgenderip_addressageAge/GenderMaleFemale
1​
RaymundLe Noirrlenoir0@java.comMale185.190.34.110
25​
25​
2​
3​
2​
LinnellBauslbaus1@vk.comFemale61.140.171.176
61​
26​
1​
3​
3​
BennieBrecknallbbrecknall2@ucoz.comFemale80.20.190.45
36​
4​
BalduinCranbcran3@tinypic.comMale208.214.65.175
65​
5​
NobieKlempsnklemps4@list-manage.comMale185.86.113.143
25​
6​
MintaLawtymlawty5@wikipedia.orgFemale178.93.114.31
68​
7​
MorgunMattheismmattheis6@bloomberg.comMale2.108.19.78
75​
8​
FlorindaO'Dowgainefodowgaine7@360.cnFemale69.176.51.97
42​
9​
BarbaraMincibminci8@paginegialle.itFemale145.221.30.213
51​
10​
GardnerCackroftgcockroft9@apache.orgMale203.161.101.51
26​
11​
SunnyHannabussshannabussa@cbslocal.comFemale188.202.200.139
42​
12​
CelestiaAbramowskycabramowskyb@home.plFemale161.146.186.244
26​
13​
DanielaHortopdhortopc@wp.comFemale142.235.65.156
25​
14​
MinerMatesmmatesd@dropbox.comMale48.139.220.69
42​
15​
RayIsacrisace@artisteer.comMale98.152.55.108
36​
16​
LuceLinskeyllinskeyf@hhs.govMale167.241.111.71
42​
17​
BrynnaJeanenetbjeanenetg@japanpost.jpFemale186.135.174.36
25​
18​
HeatherDeackeshdeackesh@imgur.comFemale21.185.193.192
26​
19​
AgneseWoodwardawoodwardi@timesonline.co.ukFemale210.7.185.141
25​
20​
EleanorArsnellearsnellj@cargocollective.comFemale187.194.185.152
26​
I tried this and it just comes up with zero
 
Upvote 0
You should upload example file with your formula has problem to check it.
 
Upvote 0
Index Match gets only one value from a matrix

There is something wrong with your formula and we can't help unless you can show us the sheet sorry
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,342
Members
448,570
Latest member
rik81h

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