Lookup and match multiple values separated by commas in a cell and produce matched value

abdulrahim845

New Member
Joined
Mar 13, 2023
Messages
18
Office Version
  1. 2016
Platform
  1. Windows
C2:C7 has single non-sequential numbers and B2:B7 has multiple numbers separated by commas in each cell. I want to match the C2 numbers in B2:B7 and get the output of the corresponding matching number in D2. Can anyone help me formulate this? Thanks
 

Attachments

  • Matched Values.JPG
    Matched Values.JPG
    71.6 KB · Views: 25
I am using VBA for the first time. Maybe I did some mistake. Now I re-apply and it runs smoothly, but it didn't get all values. What may the error be?

Match Result.xlsm
BCDE
1Non-Sequential ValuesValuesMatched Result
2740023485209026664278135, 786714215335, 884984185218, 88494962764702666427813526664278135
3029695323003716184544086, 089238300212, 342192107809, 342192107748, 892383002128, 611102105656, 015568971242, 781163724247892383002128
4029695323010660048001959, 622013297958, 078433272189, 885137765271, 626211276968, 653801183535, 799360746849653801183535
5026664278135622013297965, 069408137190, 740023485209, 660048001966, 626211276951740023485209
665380118353502969532301002969532301029695323010
7892383002128029695323003, 78671452679002969532300329695323003
Sheet1
It only returns values, starting from "0"
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I don't know why you posted the same question twice.
mr excel questions 14.xlsm
ABCDE
1740023485209026664278135, 786714215335, 884984185218, 884949627647026664278135026664278135
2029695323003716184544086, 089238300212, 342192107809, 342192107748, 892383002128, 611102105656, 015568971242, 781163724247892383002128892383002128
3029695323010660048001959, 622013297958, 078433272189, 885137765271, 626211276968, 653801183535, 799360746849653801183535653801183535
4026664278135622013297965, 069408137190, 740023485209, 660048001966, 626211276951740023485209740023485209
5653801183535029695323010029695323010029695323010
6892383002128029695323003, 786714526790029695323003029695323003
7
Sheet8
Cell Formulas
RangeFormula
D1:D6D1=IFERROR(IF(ISNUMBER(FIND(",",$B1,1))=FALSE, INDEX($A$1:$A$6,MATCH(B1,$A$1:$A$6,0)), MID($B1,SUM(IFERROR(FIND($A$1:$A$6,B1),0)), FIND(",",$B1,1+SUM(IFERROR(FIND($A$1:$A$6,B1),0)))- SUM(IFERROR(FIND($A$1:$A$6,B1),0)))),"")
 
Upvote 0
Hi, I just joined the platform. I posted the same question twice by mistake. 2nd it's only returning the value in D5.
 
Upvote 0
did you have to adjst the formula or anything? as you can see it is working in all cells it is copied into.
 
Upvote 0
did you have to adjst the formula or anything? as you can see it is working in all cells it is copied into.
I made the same scenario as you did. Column A with A1 and so on. Then paste the formula, returning the value in D5 only

Match Result.xlsx
ABCD
1740023485209026664278135, 786714215335, 884984185218, 884949627647026664278135 
2029695323003716184544086, 089238300212, 342192107809, 342192107748, 892383002128, 611102105656, 015568971242, 781163724247892383002128 
3029695323010660048001959, 622013297958, 078433272189, 885137765271, 626211276968, 653801183535, 799360746849653801183535 
4026664278135622013297965, 069408137190, 740023485209, 660048001966, 626211276951740023485209 
5653801183535029695323010029695323010029695323010
6892383002128029695323003, 786714526790029695323003 
Sheet1
Cell Formulas
RangeFormula
D1:D6D1=IFERROR(IF(ISNUMBER(FIND(",",$B1,1))=FALSE,INDEX($A$1:$A$6,MATCH(B1,$A$1:$A$6,0)),MID($B1,SUM(IFERROR(FIND($A$1:$A$6,B1),0)),FIND(",",$B1,1+SUM(IFERROR(FIND($A$1:$A$6,B1),0)))-SUM(IFERROR(FIND($A$1:$A$6,B1),0)))),"")
 
Upvote 0
OKAY, instead of pressing the ENTER key to enter the formula, use this keyboard combination: CNTL-SHIFT-ENTER
 
Upvote 0
For the current data set it's working fine, but when I apply the same on a similar large data set having A1:A1301 its returning missing values
 
Upvote 0
For the current data set it's working fine, but when I apply the same on a similar large data set having A1:A1301 its returning missing values
you need to change all the 6's in the formula to 1301 (but I suggest 2000 if you are going to be adding many more each month.)
 
Upvote 0
Excel Formula:
=IFERROR(IF(ISNUMBER(FIND(",",$B1,1))=FALSE,INDEX($A$1:$A$2000,MATCH(B1,$A$1:$A$2000,0)),MID($B1,SUM(IFERROR(FIND($A$1:$A$2000,B1),0)),FIND(",",$B1,1+SUM(IFERROR(FIND($A$1:$A$2000,B1),0)))-SUM(IFERROR(FIND($A$1:$A$2000,B1),0)))),"")

Remember to enter the formula as CTRL-SHIFT-ENTER
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
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