combine similarity matrices

sarahfish

New Member
Joined
Apr 4, 2013
Messages
3
Hi,

I have been trying everything to combine similarity matrices, but cannot get the code to work. I have blank matrix that needs to be filled in with the sum of the cells in all of the above matrices. I pasted below an example of what I mean. The number in brackets on the bottom matrix are what the data SHOULD be...not what I actually have successfully written code for.

The data is symmetrical, and each matrix repeats on every 10th line. I tried doing the operation from an earlier question (to sum every nth line), but could not get it to work. Maybe because the txt got in the way? I'm so lost and desperate! If it helps at all, this is the code I was using that I couldn't get to work...

=SUMPRODUCT((MOD(ROW($B$3:$B$29),10)=0)*($B$3:$B$29))

My data looks like this (except a LOT more cases)! THANK YOU SO MUCH!!!
____________________________________________________________________________________________
ID_350BrotherFatherUncleCousinGrandsonSonNephewGodfather
Brother
Father0
Uncle21
Cousin040
Grandson1221
Son31124
Nephew112144
Godfather0633403
ID_351BrotherFatherUncleCousinGrandsonSonNephewGodfather
Brother
Father1
Uncle30
Cousin312
Grandson2142
Son32134
Nephew222131
Godfather2212222
AggregateBrotherFatherUncleCousinGrandsonSonNephewGodfather
Brother
Father[1]
Uncle[5]
Cousin[3]
Grandson[3]
Son[6]
Nephew[3]
Godfather[2]

<tbody>
</tbody>
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I'm a little confused about your data, is the 3rd table the expected outcome? the sum of each of the row headers?
 
Upvote 0
Very understandable that the data is confusing. And THANK YOU for responding!!

The bottom table is a sum of all the tables above (in my real data I have about 400). The individual tables are a count of each person's responses. I need to sum up how many times EVERYONE from the sample had the same response.

For example, the first person (ID_350) paired 'Father/Brother' 0 times, and the second person (ID_351) paired it one time. So the 'Father/Brother' cell in the bottom matrix should be a total of how many times 'Father/Brother' was paired in the entire sample (in this 2-person sample, it was paired 1 time).

I need to figure out code that will fill in the total for each cell in the bottom table...for 400 people. Hence, the desperation..... :eek:

THANK YOU AGAIN!!!!
 
Upvote 0
Probably not the best solution but I'm stuck on an alternative at the moment.

Excel 2010
ABCDEFGHI
1ID_350BrotherFatherUncleCousinGrandsonSonNephewGodfather
2Brother
3Father0
4Uncle21
5Cousin040
6Grandson1221
7Son31124
8Nephew112144
9Godfather0633403
10
11ID_351BrotherFatherUncleCousinGrandsonSonNephewGodfather
12Brother
13Father1
14Uncle30
15Cousin312
16Grandson2142
17Son32134
18Nephew222131
19Godfather2212222
20
21AggregateBrotherFatherUncleCousinGrandsonSonNephewGodfather
22Brother0
23Father1
24Uncle5
25Cousin3
26Grandson3
27Son6
28Nephew3
29Godfather2

<tbody>
</tbody>
Sheet5

Worksheet Formulas
CellFormula
B22=SUMIF($A$2:$A$19,A22,$B$2:$I$19)
B23=SUMIF($A$2:$A$19,A23,$B$2:$I$19)
B24=SUMIF($A$2:$A$19,A24,$B$2:$I$19)
B25=SUMIF($A$2:$A$19,A25,$B$2:$I$19)
B26=SUMIF($A$2:$A$19,A26,$B$2:$I$19)
B27=SUMIF($A$2:$A$19,A27,$B$2:$I$19)
B28=SUMIF($A$2:$A$19,A28,$B$2:$I$19)
B29=SUMIF($A$2:$A$19,A29,$B$2:$I$19)

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
Awesome! Thank you!

Do you think it would work with all 400 cases? I was worried that excel limits the number of arguments you can use.

THANKS AGAIN!!!
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,352
Members
449,080
Latest member
Armadillos

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