I have a problem with a conditional MATCH() formula and can not understand why it is not working!
Assume that the spreadsheet is set out as follows:
Cells A2 to A82 contain a value of between 1 and 9
Cells B2 to J82 will contain a number of values also between 1 and 9. These are created by formula so that column B will always have a 1 or a blank (""), column C will always have either a 2 or a blank(""), column D will always have a 3 or a blank("") and
so forth through to column J always having either a 9 or a blank("").
I have a formula in cell K3 designed to provide the MATCH() value for the first instance of a given number in column B (specified in K1) for a given number in column A (specified in K2) as follows:
=MATCH(K1,IF($A$2:$A$82=K2,INDEX($B$2:$J$82,0,K1)),0) [entered as an array formula using CTRL-SHIFT-ENTER].
This provides the relative position of the first instance of value K1 in the correct column where the values in A2:A82 are the same as K2.
I now need to do the same again, but to find the second instance and have tried using:
=MATCH(K1,IF($A$2:$A$82=K2,OFFSET($A$1,K3+1,K1,81-K3,1)),0) [also entered as an array formula using CTRL-SHIFT-ENTER].
This does not work as intended. In trying to debug, I have changed the formula to specify the range provided by the OFFSET and the formula works, I have also changed the formula so that it simply sums the range provided by the OFFSET to check that this is
working and this is also fine, but the two elements will not work together.
Please help!!