Vlookup - create new list from existing list based on partial match

unknown_brother

New Member
Joined
May 12, 2018
Messages
3
I'm trying to use formulae only to create a new list of data from a master data set using criteria in a lookup column.
I'm hoping for my formula to follow these steps:
1 Take value in lookup list (cell will be locked i imagine).
2 Lookup cells in B1:B15 partially containing value in $D$2.
3 When a match is found, stop, copy complete value in column B plus adjacent value in column C. Add value to G & H column (G4:H4 for first entry in example)
4 After first entry, formula will move to next row in column G (G4) (MOst likely drag cells G4:H4)
5 Move to next row in column B and continue lookup.
6 Repeat step 3 & 4 everytime a match is found.

This is pretty much the jist of it. I'm new to formulae in excel so any help would be appreciated.
vlookup is great but couldn't combine with other function to do step 4

[TABLE="class: grid, width: 1000, align: center"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]AC10-F300042 [/TD]
[TD]3[/TD]
[TD]Lookup criteria[/TD]
[TD][/TD]
[TD][/TD]
[TD]New list[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]AC10-F300042 [/TD]
[TD]5[/TD]
[TD]-LL[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]GW10-F300024[/TD]
[TD]3[/TD]
[TD]-LQ[/TD]
[TD][/TD]
[TD][/TD]
[TD]-LL List[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][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/TD]
[TD]AC10-LQL078[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]BC10-LQL002[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]AC10-LQL002[/TD]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]AC10-LQL002[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
In G4 control+shift+enter, not just enter, and copy down"

=IFERROR(INDEX($B$1:$B$13,SMALL(IF(ISNUMBER(SEARCH($D$2,$B$1:$B$13)),ROW($B$1:$B$13)-ROW($B$1)+1),ROWS($G$4:G4))),"")

In H4 just enter and copy down:

=IF($G4="","",SUMIFS($C$1:$C$13,$B$1:$B$13,$G4))

Repeat the foregoing in a separate location For D3, etc.
 
Upvote 0
Welcome to the MrExcel board!

See if this is any use.
All standard-entry formulas:
G3 copied across as far as you might need after adjusting my range $D$2:$D$10 so that it will be enough to cover the longest list that you might use in that column.
G4 & H4 copied down as far as you might need.
G4:Hx copied and pasted to I4, K4 etc

Excel Workbook
BCDEFGHIJKL
1AC10-F3000423Lookup criteriaNew lists
2AC10-F3000425-LL
3GW10-F3000243-LQ-LLValue-LQValue-F3Value
4AC10-F300018-F3AC13-LLU0076AC10-LQL0785AC10-F3000423
5DR10-F30005218AC10-LLU0036BC10-LQL0025AC10-F3000425
6AC10-F300032477DR10-LLU0035AC10-LQL0027GW10-F3000243
7AC13-LLU0076AC10-LQL0026AC10-F300018
8AC10-LLU0036DR10-F30005218
9DR10-LLU0035AC10-F300032477
10AC10-LQL0785
11BC10-LQL0025
12AC10-LQL0027
13AC10-LQL0026
Lists
 
Upvote 0
THanks a mil.
It was very helpful.

How would I go about this if I wanted to create a single list with values containing only the following characters from my look up criteria '-LQ' and 'F3'?
 
Upvote 0
THanks a mil.
It was very helpful.

How would I go about this if I wanted to create a single list with values containing only the following characters from my look up criteria '-LQ' and 'F3'?

Is this the output you expect from the sample you already provided?

[TABLE="class: grid, width: 232"]
<tbody>[TR]
[TD]New list[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AC10-F300042[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]GW10-F300024[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]AC10-F30001[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]DR10-F3000521[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]AC10-F3000324[/TD]
[TD="align: right"]77[/TD]
[/TR]
[TR]
[TD]AC10-LQL078[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]BC10-LQL002[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]AC10-LQL002[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Is this the output you expect from the sample you already provided?

[TABLE="class: grid, width: 232"]
<tbody>[TR]
[TD]New list[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AC10-F300042[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]GW10-F300024[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]AC10-F30001[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]DR10-F3000521[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]AC10-F3000324[/TD]
[TD="align: right"]77[/TD]
[/TR]
[TR]
[TD]AC10-LQL078[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]BC10-LQL002[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]AC10-LQL002[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Correct. This would be a modification of my original request.
New list would only contain -F3 and -LQ values
 
Upvote 0
Correct. This would be a modification of my original request.
New list would only contain -F3 and -LQ values

D2:D3 houses the criteria -F3 and -LQ.

In G2 control+shift+enter, not just enter, and copy down:

=IFERROR(INDEX($B$1:$B$13,SMALL(IF(FREQUENCY(IF($B$1:$B$13<>"",IF(ISNUMBER(MATCH(LEFT(REPLACE($B$1:$B$13,1,FIND("-",$B$1:$B$13)-1,""),3),$D$2:$D$3,0)),MATCH($B$1:$B$13,$B$1:$B$13,0))),ROW($B$1:$B$13)-ROW($B$1)+1),ROW($B$1:$B$13)-ROW($B$1)+1),ROWS($G$2:G2))),"")

In H2 just enter and copy down:

IF($G2="","",SUMIFS($C$2:$C$13,$B$2:$B$13,$G2))
 
Upvote 0
I'm not convinced that you have checked the list in post #5 accurately. My reasons for doubts are ..

a) If 13 is the correct result for the last row, then surely the result for the first row should be 8, not 5.


b) Your original post contained detailed steps which included
3 When a match is found, stop, copy complete value in column B plus adjacent value in column C. Add value to G & H column (G4:H4 for first entry in example)
4 After first entry, formula will move to next row in column G (G4) (MOst likely drag cells G4:H4)
5 Move to next row in column B and continue lookup.
6 Repeat step 3 & 4 everytime a match is found.
If those steps were followed then one part of the results would be

AC10-LQL002 ...7
AC10-LQL002 ...6

not

AC10-LQL002 ...13


In case those original steps are in fact correct and you want each row individually (ie 7 & 6 not 13), then try

Excel Workbook
BCDEFGH
1AC10-F3000423Lookup criteria
2AC10-F3000425-LQ
3GW10-F3000243-F3
4AC10-F300018AC10-F3000423
5DR10-F30005218AC10-F3000425
6AC10-F300032477GW10-F3000243
7AC13-LLU0076AC10-F300018
8AC10-LLU0036DR10-F30005218
9DR10-LLU0035AC10-F300032477
10AC10-LQL0785AC10-LQL0785
11BC10-LQL0025BC10-LQL0025
12AC10-LQL0027AC10-LQL0027
13AC10-LQL0026AC10-LQL0026
14
Lists (2)




If you do want identical codes combined into one row (ie 13 instead of 7 & 6) then you could consider this alternative

Excel Workbook
BCDEFGH
1AC10-F3000423Lookup criteria
2AC10-F3000425-LQ
3GW10-F3000243-F3
4AC10-F300018AC10-F3000428
5DR10-F30005218GW10-F3000243
6AC10-F300032477AC10-F300018
7AC13-LLU0076DR10-F30005218
8AC10-LLU0036AC10-F300032477
9DR10-LLU0035AC10-LQL0785
10AC10-LQL0785BC10-LQL0025
11BC10-LQL0025AC10-LQL00213
12AC10-LQL0027
13AC10-LQL0026
14
Lists (3)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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