I think this is what you meant:
- Current item is THIS
- Select for all items whose A = this.A and whose B = this.B
- Check the rank of THIS in the list of all matched items.
The appropriate code, in your case is:
Let's break it down:
filter(F$2:F,C$2:C=C2,I$2:I=I2) gives you a list of all column F values whose corresponding C & I value matches C2 and I2, respectively.
sort(...) sort the list in ascending order (lowest number first)
match(F2, sort(...)) gives you the rank of F2 in the matched F value list
To set the color automatically
- select F2:F100
- select "Format" >> "Conditional Formatting..."
- in "format cell if", choose "custom formula is"
- in the formula field, put
- set the format style for the lowest ranked item
Repeat the steps, but change the last number of the formula to 2, 3, 4... and set the appropriate format style
Note the formula assumes that there will never be identical F values
If you want to rank by descending order (greatest number first), you need to change formula to the following:
sort(...) is now
match(...) is now
See match, sort, and filter
This is close to what I was wanting so I made a Sheet that will hopefully show you what I mean, since i'm very bad at explaining xD,