I have 2 sheets in my workbook on sheet1 there is a value for x in Q2 an a value for y in R2. In sheet 2 there are 3 columns - A contains x values, B contains Y values and C contains postcodes. What I would like to do is check the value of Q2 against those in column A on sheet2 and as soon as a value in A is higher than Q2 then R2 is checked against column B from that point until a value in B is higher than R2 and then the corresponding postcode in column C is the output.
For example: Q2 = 500877, R2 = 151590
on sheet2
_____A_______B________C
__141304___934035___HS20DB
__508783___100001___RH149RU
__508783___160389___TW178HL
__617755___168208___CT65JY
so here Q2 is less than 508783 in A and R2 is less than 160389 in B so the output is TW178HL.
For example: Q2 = 500877, R2 = 151590
on sheet2
_____A_______B________C
__141304___934035___HS20DB
__508783___100001___RH149RU
__508783___160389___TW178HL
__617755___168208___CT65JY
so here Q2 is less than 508783 in A and R2 is less than 160389 in B so the output is TW178HL.