biomathics23
New Member
- Joined
- Sep 10, 2018
- Messages
- 6
Hello and thanks for reading,
I have a setup similar to the following (but much larger), featuring a single column containing names (each cell in this column will have a name), and several columns whose cells may contain letters (though many do not). Each name is unique but more than one letter may appear in a single cell as follows:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Row[/TD]
[TD]Names[/TD]
[TD]Letters1[/TD]
[TD]Letters2[/TD]
[TD]Letters3[/TD]
[TD]Letters4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Yanni[/TD]
[TD]A,B[/TD]
[TD]A[/TD]
[TD][/TD]
[TD]A, C[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Zane[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Xerxes[/TD]
[TD][/TD]
[TD]B[/TD]
[TD][/TD]
[TD]A, B[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Yanni[/TD]
[TD]C[/TD]
[TD][/TD]
[TD][/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Yanni[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Xerxes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]B,C[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Zane[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am trying to find a formula that captures the following notion: Given Xerxes and A, how many rows have a "1" in the Numbers column and also have at least one "A" somewhere in Letters1-4 columns? So for Xerxes and A, only row 3 satisfies that, so the formula should return "1". For Yanni and A, rows 1 and 5 work, so the formula should return "2", etc.
I would like to use this formula to then populate a grid like the one below (results shown are based on the above example):
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Xerxes[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Yanni[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Zane[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
I tried to manipulate the sumproduct and countifs functions in a variety of ways, but I could never figure out how to get it to look at several cells (in actuality 10+) in a single row for a given letter while still summing over all the rows. The only solution I could think of would be to add a helper column of concatenated columns Letters1-4, and then sumproduct or countifs with that helper column and the name column, but I would vastly prefer avoiding such a workaround.
Any thoughts/advice/solutions?
I have a setup similar to the following (but much larger), featuring a single column containing names (each cell in this column will have a name), and several columns whose cells may contain letters (though many do not). Each name is unique but more than one letter may appear in a single cell as follows:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Row[/TD]
[TD]Names[/TD]
[TD]Letters1[/TD]
[TD]Letters2[/TD]
[TD]Letters3[/TD]
[TD]Letters4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Yanni[/TD]
[TD]A,B[/TD]
[TD]A[/TD]
[TD][/TD]
[TD]A, C[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Zane[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Xerxes[/TD]
[TD][/TD]
[TD]B[/TD]
[TD][/TD]
[TD]A, B[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Yanni[/TD]
[TD]C[/TD]
[TD][/TD]
[TD][/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Yanni[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Xerxes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]B,C[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Zane[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am trying to find a formula that captures the following notion: Given Xerxes and A, how many rows have a "1" in the Numbers column and also have at least one "A" somewhere in Letters1-4 columns? So for Xerxes and A, only row 3 satisfies that, so the formula should return "1". For Yanni and A, rows 1 and 5 work, so the formula should return "2", etc.
I would like to use this formula to then populate a grid like the one below (results shown are based on the above example):
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Xerxes[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Yanni[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Zane[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
I tried to manipulate the sumproduct and countifs functions in a variety of ways, but I could never figure out how to get it to look at several cells (in actuality 10+) in a single row for a given letter while still summing over all the rows. The only solution I could think of would be to add a helper column of concatenated columns Letters1-4, and then sumproduct or countifs with that helper column and the name column, but I would vastly prefer avoiding such a workaround.
Any thoughts/advice/solutions?