Hlookup multiple corresponding values

kac1125

Board Regular
Joined
Jul 31, 2014
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am looking for a formula that will list out all the possible transport modes horizontally to the right of Item. all the transport mode associated with the ship ID can be found on sheet 2. I need to see them all horizontally next to item in sheet 1. Please let me know if you have any ideas


Sheet1
A1 B1 C1
Ship IDItemTransport mode
100819-0000116

<tbody>
</tbody>
111123
100812-0000135

111124


<tbody>
</tbody>

Sheet 2
A1 B1
Ship IDTransport mode
100819-0000116Truck 1
100819-0000116Truck 2
100819-0000116Truck 3
100812-0000135Truck 1
100812-0000135Truck 2

<tbody>
</tbody>


Thanks in advance!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
In C2 of Sheet1 control+shift+enter, not just enter, and copy down:

=TEXTJOIN(", ",TRUE,IF(Sheet2!$A$2:$A$6=$A2,Sheet2!$B$2:$B$6,""))
 
Upvote 0
Thank you for reviewing. This worked, but is there a way to make it so the Transport modes each show in their own Cells? so for Ship ID 100819-0000116 i would want truck 1 in C2 truck 2 in D2 and truck 3 in E2 and so forth if there are more records.
Please let me know. Thanks again for your help!
 
Upvote 0
Thank you for reviewing. This worked, but is there a way to make it so the Transport modes each show in their own Cells? so for Ship ID 100819-0000116 i would want truck 1 in C2 truck 2 in D2 and truck 3 in E2 and so forth if there are more records.
Please let me know. Thanks again for your help!

In C2 of Sheet1 control+shift+enter, not just enter, copy across, and down:

=IFERROR(INDEX(Sheet2!$B$2:$B$6,SMALL(IF(Sheet2!$A$2:$A$6=$A2,ROW(Sheet2!$B$2:$B$6)-ROW(Sheet2!$B$2)+1),COLUMNS($C2:C2))),"")
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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