LOOKUP & COMBINE

ekhawaja

Board Regular
Joined
Dec 16, 2018
Messages
68
Office Version
  1. 365
So I am looking for a formula for column"result" that looks up the value from LOOKUP in DATA1, and if the value is repeated in DATA1, the result should show both values of DATA2 "concatenated" (separated by comma ",".).....see table below:

I have data in the range of 1000s that I will be running this against. If no value is found, result should show blank. Thanks in advance!

DATA1DATA2LOOKUPRESULT
54-PX-142JAY51-PX-370AFZ
71-PX-614BALI41-PX-156
71-PX-132BRIA54-PX-142JAY,JAY,KAY
42-SV-280MIA30-PX-140
54-PX-142JAY42-SV-280MIA
71-PX-132BRIO
51-PX-370AFZ
54-PX-142KAY
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try:

Book1
ABCDE
1
2DATA1DATA2LOOKUPRESULT
354-PX-142JAY51-PX-370AFZ
471-PX-614BALI41-PX-156 
571-PX-132BRIA54-PX-142JAY,JAY,KAY
642-SV-280MIA30-PX-140 
754-PX-142JAY42-SV-280MIA
871-PX-132BRIO
951-PX-370AFZ
1054-PX-142KAY
Sheet3
Cell Formulas
RangeFormula
E3:E7E3=TEXTJOIN(",",1,FILTER(B$3:B$10,A$3:A$10=D3,""))
 
Upvote 0
Solution
thank you so much @Eric W ..it works!
Trying to run this formula again, but this time i have numbers in col B, but the formula isn't working. I have a range of 50,000 rows.


DATA1DATA2LOOKUPRESULT
54-PX-142249851651-PX-37010456
71-PX-614B236514541-PX-156
71-PX-132B0489654-PX-1422498516,23232,2
42-SV-28096785330-PX-140
54-PX-1422323242-SV-280967853
71-PX-132B11111
51-PX-37010456
54-PX-1422
 
Upvote 0
It worked for me, did you change the range in the formula? If that is starting in A1, then:
=TEXTJOIN(",",1,FILTER(B$2:B$9,A$2:A$9=D2,""))
 
Upvote 0
Thanks you for the reply...it is still not working...could it be because i only have numbers in col A now ?

=TEXTJOIN(",",1,FILTER(Sheet2!D:D,Sheet2!C:C=FT!C129,""))

the above is what I am running at the moment in my sheet.
 
Upvote 0
col A has mixture of just numbers (29862555) or letter/number (PT-4-2562X) COMBINATION.
 
Upvote 0
the formula isn't working
In what way is it not working?
  • Does it return an error?
  • Does it miss some of the results it should return?
  • Does it return extra results that it should not return?
  • Something else?
 
Upvote 0
It just gives an error #N/A for all the cells....so it is something that i am inputting is wrong....

Could it be because the range is too big?
 
Last edited:
Upvote 0
It just gives an error #N/A for all the cells
Do you have any #NA values in Sheet2 in either columns C or D?

BTW, is this formula on the 'FT' sheet?

Although not related to the error, I suggest that you do not use whole column references. You are asking Excel to process over 1 million rows in the formula when you only have 50,000 rows of data.
Change the range to a much smaller number of rows while still ensuring it will be plenty big enough to cover your data (perhaps 60,000 or 100,000 rows)
 
Upvote 0

Forum statistics

Threads
1,226,453
Messages
6,191,134
Members
453,642
Latest member
jefals

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