Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Excel - 3x way lookup (Formula help)

Posted on 2013-11-23
4
503 Views
Last Modified: 2013-11-24
Hi,

Need some assistance trying to complete a multi-lookup formula (and avoiding the SUMPRODUCT function (it's slow and the dataset will be of large size)).

I've attached some sample data for reference. The columns may change position so using the VLOOKUP function with fixed columns won't suffice.

The requirement is the following;

Look up a certain project - let's use 'A3' (Project A)
If the project exists, then lookup 'D2' (Stage 3) intersection/corresponding value to see if the value is equal to 'Authorised'
If the project exists then lookup 'E2' (Artefact #1) intersection/corresponding value to see if the value is equal to 'Complete'
If all of the above, the test is satisfied so output the number '1', if false, output '0'

Thanks

Sample data
0
Comment
Question by:just4kix
  • 2
4 Comments
 
LVL 50

Assisted Solution

by:Ingeborg Hawighorst
Ingeborg Hawighorst earned 250 total points
ID: 39671948
Hello,

let's assume the table in the screenshot above has the range name ProjectList and starts in row 2. Let's also assume that the project you are looking up is specified in a cell with a range name ProjectName.

You can then use this formula:

=IFERROR(IF(AND(INDEX(ProjectList,MATCH(ProjectName,$A:$A,0)-1,MATCH("Stage 3",$2:$2,0))="Authorised",INDEX(ProjectList,MATCH(ProjectName,$A:$A,0)-1,MATCH("Artefact #1",$2:$2,0))="Complete"),1,0),0)

Open in new window


The outer Iferror() function will return a 0 if the Match() functions inside cannot find the project name.
The inner IF() function returns a 1 only if both conditions for "Stage 3" and "Artefact #1" are true.
Index/Match will find the columns, even if the position of the columns is not fixed.
Using Index/Match is faster than SumProduct and will produce good results with large datasets.

cheers, teylyn
0
 
LVL 81

Accepted Solution

by:
byundt earned 250 total points
ID: 39672229
A somewhat shorter array-entered formula would be:
=1-ISNA(MATCH(1,1/((Table1[Project_Name]=ProjectName)*(Table1[Stage 3]="Authorised")*(Table1[Artefact '#1]="Complete")),0))

The above formula assumes that your table is named Table1 and that the name of the project you are evaluating is in a named range ProjectName. This formula uses structured references, so you can move the columns as long as you don't change the header labels.

The MATCH function is looking for all three criteria to be satisfied on the same row. If so, each Boolean expression returns TRUE. When used in arithmetic operations, the TRUE is converted to a 1. So 1/(Boolean expressions) would equal 1 and the MATCH would succeed.

The ISNA function returns TRUE if the MATCH can't find a match for all three criteria. This is converted to a 1 by using it in an arithmetic expression, so the formula returns 0. If a match is found, ISNA returns FALSE and (1-FALSE) = 1

To array-enter a formula: click in the formula bar, hold Control and Shift keys down, hit Enter, release all three keys. Excel should respond by adding curly braces { } surrounding your formula.
3CriteriaQ28302253.xlsx
0
 

Author Comment

by:just4kix
ID: 39672478
Both tremendous answers.

I must admit my thinking was along the lines of the first answer however the second is genius. That being said, this formula can be easily void if an array formula is not entered correctly (i.e. the outcome will be the direct opposite). As byundt stated, this mustbe executed as an array to work properly.

Many thanks
0
 

Author Closing Comment

by:just4kix
ID: 39672480
Either method will work
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question