We help IT Professionals succeed at work.

Lookup formula with multiple criteria and dynamic column

What formula can produce these results? (that is fast, for a big data set)

lookup
Comment
Watch Question

Tom FarrarConsultant
BRONZE EXPERT

Commented:
Looks like you are just pivoting the data.  Couldn't a pivot table work?  I am guessing there is more to this...
Bill PrewTest your restores, not your backups...
SILVER EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Here's an approach using INDEX and MATCH, not sure how well it will scale if you have an extremely large data set, but give it a try.

Not that these are array formulas so if you edit them you have to press CTRL+SHIFT+ENTER to accept the changes.

EE29174563.xlsx


»bp
BRONZE EXPERT
Commented:
I gave you an example using a helper column in your past question
byundtMechanical Engineer
SILVER EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
Arana's approach (concatenating the lookup parameters) is going to be the fastest when you have a large lookup table. The speed will be up to a thousand times faster doing it that way when you use Office 365 compared to Excel 2016 perpetual (or earlier) because Microsoft is now indexing the lookup column.

Author

Commented:
I see the point you are making, and understand, but how can it handle the new criteria around the funkiness of how they are using AMOUNT/NUMBER (different from original question before)

Also, a bit complicated as the data set comes from a database/data connection, which I now would need to "edit"post refresh with vba or something (still better than a crashing sheet)

Author

Commented:
This can be workable, but why am I getting any/wrong answers for the cells in red, they "should" be N/A.

almost working
byundtMechanical Engineer
SILVER EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
You omitted the last parameter on the VLOOKUP. It should be either FALSE or 0, just before the rightmost parenthesis.

Without that parameter, Excel assumes your lookup table is sorted in ascending order by its first column and gives you an approximate match.

Author

Commented:
omg, that's hilarious, my brain is fried. THANK YOU both soooo much....