Vlookup with two columns?

gambils

Active Member
Joined
Apr 22, 2009
Messages
256
Possible to do a v-lookup using "and" to look up both first and last names (currently in two columns)? Alternatively, suppose I could combine first and last... Other ideas?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hello,

try to use as the first vlookup argument cells(a,b)&" "&cells(x,y) and it should work

Regards,

Alex
 
Upvote 0
Possible to do a v-lookup using "and" to look up both first and last names (currently in two columns)? Alternatively, suppose I could combine first and last... Other ideas?

Control+shif+enter, not just enter:

=INDEX(ResultRange,MATCH(1,IF(FirstNameRange=FirstName,IF(LastNameRange=LastName,1)),0))

Replace the placeholders with the relevant ranges and cells.

If this is not what you need, try to post the table you have.
 
Upvote 0
Andrew,

=INDEX(C$1:C$5,MATCH(1,INDEX((A$1:A$5=D1)*(B$1:B$5=E1),),FALSE))

the second index isn't going to return anything right? The above mentioned formula will return C$1:C$5 if D1 =A$1:A$5 and E1=B$1:B$5 right?
 
Upvote 0
noted.

in:
INDEX(ResultRange,MATCH(1,IF(CdtRange1=cdt1,IF(cdtRange2=cdt2,1)),0))

The ResultRange here is contained in a column.

Is it possible to extend said INDEX to several columns eg A2:I6 and add to the present MATCH one more condition CdtRange3?

CdtRange1 being in a Column (B2:B6)
CdtRange2 being in a Column (A2:A6)
CdtRange3 being in a Row (C1:I1)

Thanks to share your opinion.
 
Upvote 0
You have 7 columns there, but only 5 rows. Maybe it would help if you posted some sample data with the expected result.
 
Upvote 0
considering a raw data not limited to this range:
HTML:
genus	Month	conchio1	conchio2	conchio3	conchio4	conchio5	conchio6	conchio7
maxima	Jan-12	12	13	14	23	34	34	23
margtfr	Feb-12	11	11	11	12	14	14	12
fragls	Mar-12	44	56	68	76	8	8	76
gigas	Apr-12	-6	5	2	2	5	6	8
crocea	Feb-12	7	9	5	8	9	2	3

(We do have more occurrence of Genus per month and level of conchio per reading.)

the output would look like:
HTML:
level	genus	Jan-12	Feb-12	Mar-12	Apr-12
conchio1	maxima	12			
conchio1	margtfr		11		
conchio1	fragls			44	
conchio1	gigas				-6
conchio1	crocea		7		
conchio2	maxima	13			
conchio2	margtfr		11		
conchio2	fragls			56	
conchio2	gigas				5
conchio2	crocea		9

This goes down to conchio7 returning the corresponding values from table 1 if conditions are met.

Presently using this:

=IFERROR(IF($A17="a",INDEX($C$2:$C$6,MATCH(1,IF(($B$2:$B$6=C$16),IF(($A$2:$A$6=$B17),1)),0)),
IF($A17="b",INDEX($D$2:$D$6,MATCH(1,IF(($B$2:$B$6=C$16),IF(($A$2:$A$6=$B17),1)),0)),
IF($A17="c",INDEX($E$2:$E$6,MATCH(1,IF(($B$2:$B$6=C$16),IF(($A$2:$A$6=$B17),1)),0)),
IF($A17="d",INDEX($F$2:$F$6,MATCH(1,IF(($B$2:$B$6=C$16),IF(($A$2:$A$6=$B17),1)),0)),
IF($A17="e",INDEX($G$2:$G$6,MATCH(1,IF(($B$2:$B$6=C$16),IF(($A$2:$A$6=$B17),1)),0)),
IF($A17="f",INDEX($H$2:$H$6,MATCH(1,IF(($B$2:$B$6=C$16),IF(($A$2:$A$6=$B17),1)),0)),
IF($A17="g",INDEX($I$2:$I$6,MATCH(1,IF(($B$2:$B$6=C$16),IF(($A$2:$A$6=$B17),1)),0))))))))),"")

This works but it is also absolutely cumbersome.
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,109
Members
448,548
Latest member
harryls

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