Counting with multiple criteria and different tables

Aguadiablo

New Member
Joined
Nov 29, 2013
Messages
13
I have many different tables all on one worksheet, with identical data in appearing in more than one table, but never more than once per table.

It looks something like this:

Table 1 Name | Data 1 | Data 2 | Data 3 | Data 4
Table 2 Name | Data 2 | Data 4
Table 3 Name | Data 3 | Data 4
Table 4 Name | Data 2 | Data 3 | Data 4

Is there a formula that can give the me total number of times that both Data 3 and Data 4 appear together in all the tables?

I.e. Data 3 and Data 4 both appear in Table 1, 3, & 4 so the formula should give me the number 3.
 
Is there away of modifing the formula:


=SUM((MMULT((COUNTIF(OFFSET($B$2:$E$6,ROW($B$2:$E$6)-ROW($B$2),0,1),G1:H1)>0)+0, TRANSPOSE(COLUMN(G1:H1)^0))=COUNTIF(G1:H1,"?*"))+0)

So that the character name references in G1:H1 don't need to be in adjacent cells?
</pre>
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Is there away of modifing the formula:


=SUM((MMULT((COUNTIF(OFFSET($B$2:$E$6,ROW($B$2:$E$6)-ROW($B$2),0,1),G1:H1)>0)+0, TRANSPOSE(COLUMN(G1:H1)^0))=COUNTIF(G1:H1,"?*"))+0)

So that the character name references in G1:H1 don't need to be in adjacent cells?

</PRE>

In which cells are they?
 
Upvote 0
In which cells are they?

The first lost of references are currently C2 to DP4, and the second lot are currently B3 to B122 and then each of the horizontal references are matched to each of the vertical references. So it looks like below

Cable
Cyclops
Daimon Hellstrom
Dr. Strange
Cable
N/A
#
#
#
Cyclops
#
N/A
#
#
Daimon Hellstrom
#
#
N/A
#
Dr. Strange
#
#
#
N/A

<tbody>
</tbody>

# = The number of times each combo appears.

This is the easiest way I could think of to match each of the 79 characters to the other 78. But over time more characters will be added.
 
Upvote 0
The first lost of references are currently C2 to DP4, and the second lot are currently B3 to B122 and then each of the horizontal references are matched to each of the vertical references. So it looks like below

Cable
Cyclops
Daimon Hellstrom
Dr. Strange
Cable
N/A
#
#
#
Cyclops
#
N/A
#
#
Daimon Hellstrom
#
#
N/A
#
Dr. Strange
#
#
#
N/A

<TBODY>
</TBODY>

# = The number of times each combo appears.

This is the easiest way I could think of to match each of the 79 characters to the other 78. But over time more characters will be added.

What do you mean by 'first lot' being C2:DP4 and 'second lot' B3:B122?

I looks like you want to place the criteria characters to match in a matrix structure and look for each row and column combination thereof in the data. Right? Continuing with the initial example would be more convenient...
 
Upvote 0
What do you mean by 'first lot' being C2:DP4 and 'second lot' B3:B122?

I looks like you want to place the criteria characters to match in a matrix structure and look for each row and column combination thereof in the data. Right? Continuing with the initial example would be more convenient...

Yeah that's it, with the example it'd look like

Black Cat
Black Widow
Daredevil
Domino
Black Cat
N/A
0
0
1
Black Widow
0
N/A
0
0
Daredevil
0
0
N/A
0
Domino
1
0
0
N/A

<tbody>
</tbody>
 
Upvote 0
Yeah that's it, with the example it'd look like

Black Cat
Black Widow
Daredevil
Domino
Black Cat
N/A
1
Black Widow
N/A
Daredevil
N/A
Domino
1
N/A

<TBODY>
</TBODY>

Group NameHero 1Hero 2Hero 3Hero 4 Black CatBlack WidowDaredevilDomino
AcademyHank PymHawkeyeQuicksilverTigraBlack CatN/A001
Agents of SHIELDBlack WidowHawkeyeMockingbird Black Widow0N/A00
Ambulance ChasersDaredevilShe-Hulk Daredevil00N/A0
Anything's PossibleBlack CatDominoScarlet Witch Domino100N/A
ArachnophobiaBlack WidowSpider-ManSpider-Woman

<COLGROUP><COL style="WIDTH: 146pt; mso-width-source: userset; mso-width-alt: 6912" width=194><COL style="WIDTH: 103pt; mso-width-source: userset; mso-width-alt: 4864" width=137><COL style="WIDTH: 98pt; mso-width-source: userset; mso-width-alt: 4636" width=130><COL style="WIDTH: 115pt; mso-width-source: userset; mso-width-alt: 5461" width=154><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 3640" width=102><COL style="WIDTH: 103pt; mso-width-source: userset; mso-width-alt: 4864" width=137><COL style="WIDTH: 88pt; mso-width-source: userset; mso-width-alt: 4152" width=117><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 3669" width=103><COL style="WIDTH: 65pt; mso-width-source: userset; mso-width-alt: 3100" width=87><COL style="WIDTH: 69pt; mso-width-source: userset; mso-width-alt: 3271" width=92><TBODY>
</TBODY>


G2, control+shift+enter, not just enter, copy across, and down:
Rich (BB code):
Rich (BB code):
=IF($F2=G$1,"N/A",SUM((MMULT((COUNTIF(OFFSET($B$2:$E$6,ROW($B$2:$E$6)-ROW($B$2),0,1),
  CHOOSE({1,2},$F2,G$1))>0)+0,{1;1})=2)+0))
Rich (BB code):
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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