VLookup Formula

chemicalx

New Member
Joined
Mar 26, 2021
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
So wife does RE work….column A has names of countries. column B has a result like home, remote, hybrid. column A may list a city 2x because it has more than 1 column B result. ie, China might be in column A 2x, with 1 result as home and a second result of hybrid.

On another tab she is listing each city from column A and VLookup formula is pulling in a column B result from the other column B…..but say she types China, the VLookup only pulls in 1 column B result, like hybrid. how can she get that column B to pull in everything listed for chine from the first tab (say home and hybrid)?

thx
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Can you provide a sample of your data with Xlb22? Or even a screen shot or something?
 
Upvote 0
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
1666380883332.png


Then she has another tab, she said she is using VLookup, but not sure......but here is what she has;

1666380998382.png


So, when she types China into the 2nd tab or VLookup tab, she wants column B next to China to return not just home, but work and static into B1. Right now, it only brings in 1 value, but there might be other values.

Make better sense?
 
Upvote 0
Not sure of the format you want to use and if you are only using 2016 FILTER function doesnt work so here is one option:

Book1
ABCDE
1ChinaHomeChinaLookup
2ChinaWorkChinaHome
3ChinaStaticChinaWork
4IndiaHomeChinaStatic
5EgyptStatic  
6EgyptHome  
7USHome  
8IsraelHome  
Sheet2
Cell Formulas
RangeFormula
D2:D8D2=IFERROR(INDEX(A:A,AGGREGATE(15,6,(ROW(A:A)-ROW($A$1)+1)/(ISNUMBER(MATCH(A:A,$D$1,0))),ROWS(D$2:D2))),"")
E2:E8E2=IFERROR(INDEX(B:B,AGGREGATE(15,6,(ROW(A:A)-ROW($A$1)+1)/(ISNUMBER(MATCH(A:A,$D$1,0))),ROWS(E$2:E2))),"")


If you do have filter function here is another option:
Book1
D
10China
Sheet2
Cell Formulas
RangeFormula
D10:E12D10=FILTER(A:B,A:A=D1)
Dynamic array formulas.
 
Upvote 0
Here maybe another option:
Book1
ABCDEF
1ChinaHomeChinaHome,Work,Static
2ChinaWorkIndiaHome
3ChinaStaticEgyptStatic,Home
4IndiaHomeUSHome
5EgyptStaticIsraelHome
6EgyptHome0
7USHome
8IsraelHome
Sheet1
Cell Formulas
RangeFormula
D1:D6D1=UNIQUE(A:A)
E1:E5E1=TEXTJOIN(",",TRUE,IF(D1=A:A,B:B,""))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,831
Members
449,051
Latest member
excelquestion515

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