hornsfan01
New Member
- Joined
- Jul 4, 2012
- Messages
- 7
To me, this is fairly complicated and I may have bitten off more than I can chew. But I've been searching on the internet and trying things in Excel for two days with no real success, so here goes:
I have a table of numerical values with a row of text headers at the top.
What I'd like to be able to do is to count the number of times the maximum value within each row falls within a specified column, with a hierarchy of column headers specified as "tiebreakers."
[TABLE="width: 500"]
<TBODY>[TR]
[TD][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]Tiebreaker order:
[/TD]
[TD]No. of max values:
[/TD]
[TD="align: center"]Red
[/TD]
[TD="align: center"]Yellow
[/TD]
[TD="align: center"]Green
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD]Red
[/TD]
[TD][/TD]
[TD="align: center"]6
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD]Green
[/TD]
[TD][/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD]Yellow
[/TD]
[TD][/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]3
[/TD]
[/TR]
</TBODY>[/TABLE]
The order of the column headers specified in A2:A4 is a hierarchy by which I would like to break ties for max value. I'd like to put the answers in B2:B4.
So, basically in B2, I'd like the formula to say, "Does the max value for each row of C2:E6 fall in the column whose column header equals the text in A2? If so, count=count+1. Once all rows in C2:E6 have been examined for this question, put the final count in B2."
In B3, I'd like the formula to say, "Does the max value for each row of C2:E6 fall in the column whose column header equals the text in A3? If so, then as long as the max value does not ALSO fall in the column whose header matches the text in A2, count=count+1." Final count gets put in B3.
In B4, I'd like the formula to say, "Does the max value for each row of C2:E6 fall into the column whose header equals the text in A4? If so, then as long as the max value does not also fall in either the column whose header matches A2 or A3, then count=count+1." Final count gets put in B4.
The reason I specify it like this is that, while the cells A1, B1, the answers in B2-B4, and the entire table from C1-E6 will remain static, the order of the cells in A2-A4 may be changed by the user to specify a different order of tiebreaker. So the formulas would have to look at order of tiebreaker to see whether to increment count.
So if A2:A4 was Red|Green|Yellow in that order, I'd like to end up in B2:B4 with 3 | 1 | 1
B2 gets incremented for C2:E2, C3:E3 because it shares the max value and is highest on the tiebreaker list, and C4:E4 because it shares the max value and is highest on the tiebreaker list.
B3 would be incremented for C6:E6 only.
B4 would be incremented for C5:E5 only.
Once I have those values, I'd like to then be able to go in and type, for example, Green | Yellow | Red in cells A2:A4.
I'd like to have B2:B4 recalculate and give the following values:
[TABLE="width: 500"]
<TBODY>[TR]
[TD][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]Tiebreaker Order
[/TD]
[TD]No. of max values:
[/TD]
[TD="align: center"]Red
[/TD]
[TD="align: center"]Yellow
[/TD]
[TD="align: center"]Green
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD]Green
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]6
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD]Yellow
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD]Red
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]3
[/TD]
[/TR]
</TBODY>[/TABLE]
B2 gets incremented for C3:E3, C4:E4, C5:E5, and C6:E6. Yellow does not hold any max values that Green doesn't also hold, so it stays at zero. Red gets incremented for C2:E2.
Thanks ahead of time to anyone who takes a look at this and can let me know if this is even possible.
I have a table of numerical values with a row of text headers at the top.
What I'd like to be able to do is to count the number of times the maximum value within each row falls within a specified column, with a hierarchy of column headers specified as "tiebreakers."
[TABLE="width: 500"]
<TBODY>[TR]
[TD][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]Tiebreaker order:
[/TD]
[TD]No. of max values:
[/TD]
[TD="align: center"]Red
[/TD]
[TD="align: center"]Yellow
[/TD]
[TD="align: center"]Green
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD]Red
[/TD]
[TD][/TD]
[TD="align: center"]6
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD]Green
[/TD]
[TD][/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD]Yellow
[/TD]
[TD][/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]3
[/TD]
[/TR]
</TBODY>[/TABLE]
The order of the column headers specified in A2:A4 is a hierarchy by which I would like to break ties for max value. I'd like to put the answers in B2:B4.
So, basically in B2, I'd like the formula to say, "Does the max value for each row of C2:E6 fall in the column whose column header equals the text in A2? If so, count=count+1. Once all rows in C2:E6 have been examined for this question, put the final count in B2."
In B3, I'd like the formula to say, "Does the max value for each row of C2:E6 fall in the column whose column header equals the text in A3? If so, then as long as the max value does not ALSO fall in the column whose header matches the text in A2, count=count+1." Final count gets put in B3.
In B4, I'd like the formula to say, "Does the max value for each row of C2:E6 fall into the column whose header equals the text in A4? If so, then as long as the max value does not also fall in either the column whose header matches A2 or A3, then count=count+1." Final count gets put in B4.
The reason I specify it like this is that, while the cells A1, B1, the answers in B2-B4, and the entire table from C1-E6 will remain static, the order of the cells in A2-A4 may be changed by the user to specify a different order of tiebreaker. So the formulas would have to look at order of tiebreaker to see whether to increment count.
So if A2:A4 was Red|Green|Yellow in that order, I'd like to end up in B2:B4 with 3 | 1 | 1
B2 gets incremented for C2:E2, C3:E3 because it shares the max value and is highest on the tiebreaker list, and C4:E4 because it shares the max value and is highest on the tiebreaker list.
B3 would be incremented for C6:E6 only.
B4 would be incremented for C5:E5 only.
Once I have those values, I'd like to then be able to go in and type, for example, Green | Yellow | Red in cells A2:A4.
I'd like to have B2:B4 recalculate and give the following values:
[TABLE="width: 500"]
<TBODY>[TR]
[TD][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]Tiebreaker Order
[/TD]
[TD]No. of max values:
[/TD]
[TD="align: center"]Red
[/TD]
[TD="align: center"]Yellow
[/TD]
[TD="align: center"]Green
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD]Green
[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]6
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD]Yellow
[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]4
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD]Red
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]1
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]3
[/TD]
[/TR]
</TBODY>[/TABLE]
B2 gets incremented for C3:E3, C4:E4, C5:E5, and C6:E6. Yellow does not hold any max values that Green doesn't also hold, so it stays at zero. Red gets incremented for C2:E2.
Thanks ahead of time to anyone who takes a look at this and can let me know if this is even possible.
Last edited: