excelisfun array multiple lookup in one cell

dmj120

Active Member
Joined
Jan 5, 2010
Messages
286
Office Version
  1. 365
  2. 2019
  3. 2010
:oops::oops::oops:

I came across an excelisfun video a while ago in which a lookup was used that showed all values in one cell. VERY similar to the textjoin(), but it worked in 2010.

....and of course, I can't find it, nor do I remember what I searched when I stumbled upon it....

I have a two column table, column A has names, column B has PO#s. I want to have a summary in which all the PO#s display in one cell.

Example:
Selection
PO Numbers
Josh
100, 150, 200

<tbody>
</tbody>


Name
PO Number
Josh
100
Jim
99999
Josh
150
Heather
88888
Josh
200

<tbody>
</tbody>


Does anyone know what I can search to find the video, or give me a starting point??

Thanks!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
you can try with PowerQuery (free add-in for 2010)

NamePO NumberNamePO Number
Josh
100​
Josh100, 150, 200
Jim
99999​
Jim99999
Josh
150​
Heather88888
Heather
88888​
Josh
200​

Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"Name"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "PO Number", each Table.Column([Count],"PO Number")),
    Extract = Table.TransformColumns(List, {"PO Number", each Text.Combine(List.Transform(_, Text.From), ", "), type text})
in
    Extract[/SIZE]
 
Upvote 0
A possible solution without TEXTJOIN or Macro


A
B
1
Selection​
PO Numbers​
2
Josh​
100, 150, 200​
3
4
5
Name​
PO Number​
6
Josh​
100​
7
Jim​
99999​
8
Josh​
150​
9
Heather​
88888​
10
Josh​
200​

<tbody>
</tbody>


Select B2

Type in the Formula Bar this formula
=SUBSTITUTE(TRIM(CONCATENATE(IF(A6:A10=A2,B6:B10&" ","")))," ",", ")

With the mouse select the IF part (in red)

Hit F9 and you see
{"100 ";"";"150 ";"";"200 "}

Delete { and }

Hit Enter

Hope this helps

M.
 
Upvote 0
oops...

The solution above works only in Excel versions that use semicolon ; as argument separator

If your Excel version uses comma (,) as argument separator i think you need to TRANSPOSE the IF part.

Maybe this (NOT TESTED)
=SUBSTITUTE(TRIM(CONCATENATE(TRANSPOSE(IF(A6:A10=A2,B6:B10&" ",""))))," ",", ")

Highlight the red part and press F9
Delete { and }
Enter

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

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