Excel - 3x way lookup (Formula help)

Posted on 2013-11-23
Last Modified: 2013-11-24

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'


Sample data
Question by:just4kix
  • 2
LVL 50

Assisted Solution

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

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
LVL 81

Accepted Solution

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.

Author Comment

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

Author Closing Comment

ID: 39672480
Either method will work

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

My experience with Windows 10 over a one year period and suggestions for smooth operation
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

726 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