VLOOKUP - Multiple Criteria

gregula82

New Member
Joined
Aug 18, 2006
Messages
8
Hi Everyone,

I was wondering whether anyone knew of a way of performing a VLOOKUP function which has multiple criteria. e.g. the lookup value would have 3 separate criteria and then you put the table array in and the column index.

Any ideas???

Thanks.

Greg.
 
@Aladin

Apologies for the repeat.

I will try to simplify my question, I am trying to populate WD1 planned hours and WD1 planned cost on sheet 2 from sheet 1

sample data on Wd1 Sheet:

MonthProgramme IDProject IDResource NameTask NameWD1 PHWD1 PC
1201P268Name 1T114112
1202P298Name 2T214112
1203P299Name 3T314112
2201P268Name 4T128224
2202P269Name 1T235280
3201P269Name 2T335280
3202P268Name 3T142336
4201P299Name 4T414112
4202P268Name 5T1756
5201P298Name 6T3756
5203P268Name 1T256448
6203P267Name 2T249392
6204P268Name4T549392

<tbody>
</tbody>
Sample Data on Sheet2

MonthProgramme IDProject IDResource NameTask NamePHPCWD1 PHWD1 PC
1201P268Name 1T11411214112
1202P298Name 2T21411214112
1203P299Name 3T31411214112
2201P268Name 4T12822428224
2202P269Name 1T23528035280
3201P269Name 2T33528035280
3202P268Name 3T14233642336
4201P299Name 4T41411214112
4202P268Name 5T1756756
5201P298Name 6T3756756
5203P268Name 1T25644856448
6203P267Name 2T24939249392
6204P268Name 4T54939249392
6229P290Name 7T514112#N/A#N/A
6202P298Name 1T4756#N/A#N/A

<tbody>
</tbody>

<tbody>
</tbody>

I am looking for a formula to populate column H and I with values from sheet 1 columns F and G when a match is found. if not populate #N/A.
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi Aladain,

Hi Aladin,

The value from the combination of the following five columns should match.

MonthProgramme IDProject IDResource NameTask Name

<colgroup><col span="5" width="64"></colgroup><tbody>
</tbody>

In other words,
If [(Sheet1.A2=Sheet2.A2)And((Sheet1.B2=Sheet2.B2)And(Sheet1.C2=Sheet2.C2)And(Sheet1.D2=Sheet2.D2)And(Sheet1.E2=Sheet2.E2)=True]
then sheet2.H2 should have the value from Sheet1.F1 and sheet2.I2 should have the value from Sheet1.G2.

Hope I am making sense. Apologies for any confusion and thanks for your time in looking into it. Much appreciated.
 
Upvote 0
Hi Aladain,

Hi Aladin,

The value from the combination of the following five columns should match.

Month
Programme ID
Project ID
Resource Name
Task Name

<TBODY>
</TBODY>

In other words,
If [(Sheet1.A2=Sheet2.A2)And((Sheet1.B2=Sheet2.B2)And(Sheet1.C2=Sheet2.C2)And(Sheet1.D2=Sheet2.D2)And(Sheet1.E2=Sheet2.E2)=True]
then sheet2.H2 should have the value from Sheet1.F1 and sheet2.I2 should have the value from Sheet1.G2.

Hope I am making sense. Apologies for any confusion and thanks for your time in looking into it. Much appreciated.

Wd1, H2, copied down:

=A2&"|"&B2&"|"&C2&"|"&D2&"|"&E2

Sheet2, H2, copied across, and down:

=INDEX(Wd1!F:F,MATCH(A$2&"|"&$B2&"|"&$C2&"|"&$D2&"|"&$E2,Wd1!$H:$H,0))
 
Upvote 0
Another way:

Layout

MonthProgramme IDProject IDResource NameTask NamePHPCWD1 PHWD1 PC
1201P268Name 1T11411214112
1202P298Name 2T214112 112
1203P299Name 3T31411214112
2201P268Name 4T12822428224
2202P269Name 1T23528035280
3201P269Name 2T33528035280
3202P268Name 3T14233642336
4201P299Name 4T41411214112
4202P268Name 5T1756756
5201P298Name 6T3756756
5203P268Name 1T25644856448
6203P267Name 2T24939249392
6204P268Name 4T549392#N/D#N/D
6229P290Name 7T514112#N/D#N/D
6202P298Name 1T4756#N/D#N/D
****************************************************************************
<colgroup><col width="38" style="width: 29pt; mso-width-source: userset; mso-width-alt: 1389;"> <col width="74" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2706;"> <col width="53" style="width: 40pt; mso-width-source: userset; mso-width-alt: 1938;"> <col width="82" style="width: 62pt; mso-width-source: userset; mso-width-alt: 2998;"> <col width="58" style="width: 44pt; mso-width-source: userset; mso-width-alt: 2121;"> <col width="27" style="width: 20pt; mso-width-source: userset; mso-width-alt: 987;" span="2"> <col width="47" style="width: 35pt; mso-width-source: userset; mso-width-alt: 1718;"> <col width="44" style="width: 33pt; mso-width-source: userset; mso-width-alt: 1609;"> <tbody> </tbody>

Formula

Code:
In H2 - use Ctrl+Shift+Enter to enter the formula

=VLOOKUP($E2,IF('Wd1'!$A$2:$A$14=$A2,IF('Wd1'!$B$2:$B$14=$B2,IF('Wd1'!$C$2:$C$14=$C2,IF('Wd1'!$D$2:$D$14=$D2,'Wd1'!$E$2:$G$14)))),MATCH(H$1,'Wd1'!$E$1:$G$1,0),0)

And copy to the right and down.

Markmzz
 
Upvote 0
Not sure if this is the same or if I need to post this in another thread. This is really killing me.

I have a spreadsheet that I use VLookup to find some data. The name for the data can be STT1RM1 or it can be STT1TRM2 and the column (depending on which one exists) that I will return is column 4.

Below is my formula. Please help me understand what I am missing here.

=IF(ISNA(VLOOKUP("STT1RM1",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,FALSE)),“”,VLOOKUP("STT1RM2",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,FALSE))

Thank you! Great forum!
 
Upvote 0
Not sure if this is the same or if I need to post this in another thread. This is really killing me.

I have a spreadsheet that I use VLookup to find some data. The name for the data can be STT1RM1 or it can be STT1TRM2 and the column (depending on which one exists) that I will return is column 4.

Below is my formula. Please help me understand what I am missing here.

=IF(ISNA(VLOOKUP("STT1RM1",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,FALSE)),“”,VLOOKUP("STT1RM2",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,FALSE))

Thank you! Great forum!

If VLOOKUP is expected to return a text value when successful...
Rich (BB code):
=IFERROR(LOOKUP(REPT("z",255),
  CHOOSE({1,2},VLOOKUP("STT1RM2",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,0),
   VLOOKUP("STT1RM1",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,0))),"")
If VLOOKUP is expected to return a number when successful...
Rich (BB code):
=IFERROR(LOOKUP(9.99999999999999E+307,
  CHOOSE({1,2},VLOOKUP("STT1RM2",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,0),
   VLOOKUP("STT1RM1",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,0))),"")

Hope this helps.
 
Upvote 0
Not sure if this is the same or if I need to post this in another thread. This is really killing me.

I have a spreadsheet that I use VLookup to find some data. The name for the data can be STT1RM1 or it can be STT1TRM2 and the column (depending on which one exists) that I will return is column 4.

Below is my formula. Please help me understand what I am missing here.

=IF(ISNA(VLOOKUP("STT1RM1",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,FALSE)),“”,VLOOKUP("STT1RM2",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,FALSE))

Thank you! Great forum!

Hi ScottVP,

If I understand correctly what you want, maybe this can helps:

Code:
=IFERROR(VLOOKUP("STT1RM1",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,0),
IFERROR(VLOOKUP("STT1RM2",'C:\INV\[Fix.xlsx]servers'!$A$2:$I$1409,4,0),""))

Markmzz
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,155
Messages
6,123,335
Members
449,098
Latest member
thnirmitha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top