Hi,
I've information in two sections of a worksheet, columns A and B (range named "temp1") and columns D and E (range named "temp2"). I should also say that the reason I have two sections is that each section will have about 150 rows, so instead of having a huge list of 300 rows, I've tried splitting them into two sections.
A B
1 a
1 b
3 c
D E
4 d
1 e
6 f
What I want to do it show all the results that match the value 1 using a vlookup formula. Also the values in column A and D may change, i.e if value 4 in D1 changed to 1, I would expect to see "d" included in the results.
This is the original formula I got somewhere else which sorts out my vlookup on multiple matches issue.
=VLOOKUP($B$8,INDEX(tbl,SMALL(IF($B$8=INDEX(tbl,,1),ROW(tbl)-MIN(ROW(tbl))+1,""),ROW(1:1)),,1),2,FALSE)
I've updated it to search on each range seperately which works ok but it only returns values from one range, not both and visa versa. It is an array entered formula. In a nutshell, this formula checks if there is an error performing the lookup on range "temp1". If there is an error, it searches range "temp2". If no error, it searches range "temp1".
=VLOOKUP(H2,IF(ISERROR(INDEX(temp1,SMALL(IF(H2=INDEX(temp1,,1),ROW(temp1)-MIN(ROW(temp1))+1,""),ROW(1:1)),,1)),INDEX(temp2,SMALL(IF(H2=INDEX(temp2,,1),ROW(temp2)-MIN(ROW(temp2))+1,""),ROW(1:1)),,1),INDEX(temp1,SMALL(IF(H2=INDEX(temp1,,1),ROW(temp1)-MIN(ROW(temp1))+1,""),ROW(1:1)),,1)),2,FALSE)
I have a number of tables based on the values in columns A and D that will perform the lookup which should return the following results. I haven't put in all the tables. This is the result I want to get.
H I
1 a
1 b
1 e
J K
3 c
3
3
This is the result I'm currently getting when doing a lookup on value 1.
H I
1 a
1 b
1 #NUM!
Sorry if this confuses everyone! Ask for more details if needed. I've tried to give as much info as possible.
Any ideas on how to also search on the other range?
Thanks.
Bookmarks