Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Lookup - Another Approach

Status
Not open for further replies.

Airbisk

Technical User
Apr 28, 2009
43
GB
Hi,

I have a spreadsheet that uses the formula below to look at four criteria and return the value where all four match. I am now trying to incorporate this into a larger spreadsheet where this formula (adjusted to work) will appear on every line (approx 5000). I have changed it to work but applied it to all lines and it's very very slow to process....I quit after 7%

=LOOKUP(2,1/((FullData!A2:A650=A7)*(FullData!B2:B650=E7)*(FullData!C2:C650=I7)*(FullData!D2:D650=M7)),FullData!E2:E650)

My question is does anyone know of a better way of doing what the formula does? Any help/suggestions would be great.

Thanks
 
Yes.

Add a column in your FullData sheet (it can be any blank column. Let's assume Z:Z), with this formula (copied to the bottom of your data range)
Code:
[b]=A2&"|"&B2&"|"&C2&"|"&D2[/b]
in your main sheet, use this lookup
Code:
[b]=index(FullData!$E:$E,match(A7&"|"&E7&"|"&I7&"|"&M7,FullData!$Z:$Z,0))[/b]

Assuming I have read your requirements correctly. Note that your formula requires the use of an Array Formula, and if you have duplicate matches, you will return the last. My setup returns only the first...

If that doesn't meet your requirements, you will need to explain what you're trying to get, and provide a sample of your data with the expected results.
 
Perfect!! Making it work for the spreadsheet now and it's doing the trick....so much quicker wow!!

Thanks Gruu
 
Just keep in mind the caveat about multiple matches! If you are certain that your rows will always provide a unique result of field combinations, this will work for you. If you have multiple rows that meet a specific combination, you will want to investigate. (Adding them together is an easy SUMIF, using the same logic)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top