0
votes

Good day everyone - I am trying to create a grade sheet for my swimming classes at school. It needs to be based on a few criteria - 1. boys/girls, 2. What stroke, 3. Time swum

I have a column for Time swum and a column with a dropdown of boys freestyle, girls freestyle etc to choose from. Then a criteria table where you get 30 point for swim x time less for each stroke for boys and girls. I was trying to use index match - but that will only return one of the strokes. As seen in the image - I need Column X to return the Points from column AB based on Column T dropdown selection, based on the range of the table with all the stroke times.

I've gotten this far : =index(AB2:AB6,MATCH(S2,AG2:AG6,1)), but that assumes all are swimming backstroke and all are girls.

I am hoping I am explaining this effectively enough.

Thanks in advance for the help.

Sample page

1
What is your question? Is there a problem? - ashleedawg
@ashleedawg I think OP is trying to figure out how they can change their formula so they can programatically choose the column. Instead of just looking at the "Backstroke Girls" column, for example, they want to be able to change a text value on the sheet so it will look at a different column. Probably using the value from T2 in their screenshot. - girlvsdata
I'm pretty sure you can do it with INDEX(MATCH(),MATCH()) but I'm having trouble getting my formula to work. - girlvsdata
Hi @ashleedawg - I am trying to do a lookup for points based on time swum and stroke chosen - Ryan Kemp

1 Answers

0
votes

You can use OFFSET to move the column you are matchin to the right. Also my understanding is that is for example in column "Freestyle Girls" someone reaches time 50 she should be put into line 55 - Grade A, 25 Points. If so you will need to do this:

1) reverse order of your data lines - if you want to use MATCH with last parameter "-1" (returns lowest value greater or equal to lookup value) for time (when you reach 50, you are worse then 40 so you will go to line with 55) you will need to have the values in descending order so the grades will go D to A* instead of A* to D.

2) use formula

=IFERROR(INDEX(AB:AB,MATCH(S2,OFFSET(AB:AB,0,MATCH(T2,AC1:AF1,0)),-1)),AB2)

Basically what it does is this:

OFFSET(AB:AB,0,MATCH(T2,AC1:AF1,0))

this moves the search column for the final MATCH to match the style you select

INDEX(AB:AB,MATCH(S2,OFFSET(...),-1))

this is standard search like you tried, only the OFFSET is inside so it looks in correct column.

As there is no value above Grade D it would cause error if somone nearly drowned and took 100 to finish so you need IFERROR to make sure it correct that.

Note: this assumes that value in T matches the values in the column names AC-AH. It your example the word order seems flipped. Also I put into my formula only 4 different styles so you will need to change the part stating AC1:AF1 to contain all the styles