vlookup() returning multiple values

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I want to use vlookup() to return multiple values. User will enter the name in cell G2 and vlookup() will return phone number and address. So I selected 2 cells (I2 and J2) and typed this function

G2=VLOOKUP(G2,A2:C15,{2,3},flase)

and pressed ctrl+shift+enter

But I got error msg #Name . Not sure why? Any help would be very much appreciated.



[TABLE="class: grid, width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]name[/TD]
[TD="width: 64"]phone#[/TD]
[TD="width: 64"]address[/TD]
[/TR]
[TR]
[TD]mary1[/TD]
[TD="align: right"]1[/TD]
[TD]1 main st[/TD]
[/TR]
[TR]
[TD]mary2[/TD]
[TD="align: right"]2[/TD]
[TD]2 main st[/TD]
[/TR]
[TR]
[TD]mary3[/TD]
[TD="align: right"]3[/TD]
[TD]3 main st[/TD]
[/TR]
[TR]
[TD]mary4[/TD]
[TD="align: right"]4[/TD]
[TD]4 main st[/TD]
[/TR]
[TR]
[TD]mary5[/TD]
[TD="align: right"]5[/TD]
[TD]5 main st[/TD]
[/TR]
[TR]
[TD]mary6[/TD]
[TD="align: right"]6[/TD]
[TD]6 main st[/TD]
[/TR]
[TR]
[TD]mary7[/TD]
[TD="align: right"]7[/TD]
[TD]7 main st[/TD]
[/TR]
[TR]
[TD]mary8[/TD]
[TD="align: right"]8[/TD]
[TD]8 main st[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
VLOOKUP can only return a single value.
You would just write two VLOOKUP formulas, one to return column 2 and one to return column 3.
If you want them both in the same cell, just use CONCATENATE or & to sew them together, i.e.
Code:
[COLOR=#333333]=VLOOKUP(G2,A2:C15,2,false) & " " & [/COLOR][COLOR=#333333]VLOOKUP(G2,A2:C15,3,false)[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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