Reputation: 43
I need a formula to fill the courts and times in the first table by looking the MatchCode up in the Time Grid below. Any match could be scheduled anywhere on the grid. Vlookup would only work with the times on the right and only for the first column, Court Number wouldnt work at all with Hlookup(probably would have worked if I moved court numbers to the bottom of the table but probably only for the first row). IndexMatch and Xlookup didnt seem to work at all.
Preferably using formulas that will work on old versions of Excel too.
Upvotes: 0
Views: 82
Reputation: 2609
Assuming this situation:
Use this formula in cell B2:
=INDEX($1:$1,AGGREGATE(15,6,COLUMN($F$2:$L$14)/($F$2:$L$14=A2),1))
and this one in cell C2:
=INDEX($E:$E,AGGREGATE(15,6,ROW($F$2:$L$14)/($F$2:$L$14=A2),1))
Upvotes: 2
Reputation: 2494
The suggestion below will work in all versions of Excel (using array formulae in legacy versions):-
The formula in B2
(and copied down) is
=MATCH(1,MMULT(TRANSPOSE(N(A2=$G$2:$M$14)),ROW($1:$13)/ROW($1:$13)),0)
and the formula in C2
(and copied down) is
=(7+MATCH(1,MMULT(N(A2=$G$2:$M$14),ROW($1:$7)/ROW($1:$7)),0))/24
Upvotes: 1