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

ABCDEFGHIJKLMNO
1AC10-F300042 3Lookup criteriaNew list
2AC10-F300042 5-LL
3GW10-F3000243-LQ-LL List
4AC10-F30001 8-F3AC13-LLU0076
5DR10-F30005218AC10-LLU0076
6AC10-F300032477DR10-LLU0035
7AC13-LLU0076
8AC10-LLU003 6
9DR10-LLU003 5
10AC10-LQL0785
11BC10-LQL0025
12AC10-LQL0027
13AC10-LQL0026

<tbody>
</tbody>

 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
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?

New list
AC10-F3000425
GW10-F3000243
AC10-F300018
DR10-F30005218
AC10-F300032477
AC10-LQL0785
BC10-LQL0025
AC10-LQL00213

<tbody>
</tbody>
 
Upvote 0
Is this the output you expect from the sample you already provided?

New list
AC10-F3000425
GW10-F3000243
AC10-F300018
DR10-F30005218
AC10-F300032477
AC10-LQL0785
BC10-LQL0025
AC10-LQL00213

<tbody>
</tbody>


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,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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