Excel VLookup w/ Multiple Values AND Results

DC0429

New Member
Joined
Jan 27, 2010
Messages
28
Office Version
  1. 2019
Platform
  1. Windows
Needing some help please.
Posting this because I could not find a similar answeranywhere.

I have six worksheets… EF Copy, Stop 1, Stop 2, etc toStop 5
On the EF Copy worksheet is a download from our AS400 a deliverylist for a particular delivery route.
Worksheet shows Stop #, Customer, Product Description,Pack Size (of product), Quantity, Unit of Measure, and Customer PO number incolumns A thru G.

Each stop can have 1 to 100+ rows of items.

I need a formula so that worksheet Stop 1 only has Stop 1info, Stop 2 only Stop 2 info, and so on.

Got this working now but not well. Worksheet for stop 1 is fine… but the info onworksheet Stop 2 starts in the row where the info on worksheet Stop 1 ends,

I am sure I need an array formula w/ much more than justa normal VLookup.

Worksheet EFCopy (with ALL route info from the AS400 query):

Stop #InstitutionDescriptionPack/SizeQtyUOMPO #
1MACDONALDSTHICKENER NECTAR FD/BEV200/4.8GRAM4CS278
1MACDONALDSBEAN GREEN GR B *GRADED*6/#1016CS3610151
1MACDONALDSBEAN VEGETARIAN SCE*GRADED*6/#1010CS3610151
1MACDONALDSBEET DICED *GRADED* C401186/1012CS3610151
1MACDONALDSPOTATO WHOLE WHITE 60-80 CT C6/#106CS3610151
1MACDONALDSYAM CUT FCY C401186/106CS3610151
1MACDONALDSMUSHROOM PCS & STEMS INDIAM -6/#102CS3610151
1MACDONALDSTOMATO DICED CHO *GRADED*6/1010CS3610151
2HARDLEESBROCCOLI FROZEN1/20#4CS905
2HARDLEESVEGETABLE MIX FLORENTINE CALIF20/LB40CS905
2HARDLEESPOTATO ROUND6/5 LB50CS905
2HARDLEESPOTATO FRENCH FRY STRAIGHT6/5 LB3CS905
2HARDLEESMARGARINE CUPS SOY OIL 5GM900/5 GM133CS911
2HARDLEESMARGARINE CUPS SOY OIL 5GM900/5 GM133CS911
2HARDLEESCHEESE AMERICAN BLD 160 SLC (I1/5#100EA963
3WINDYSBROCCOLI FROZEN1/20#50CS904
3WINDYSBROCCOLI FROZEN1/20#50CS904
3WINDYSVEGETABLE MIX FLORENTINE CALIF20/LB33CS904
3WINDYSPOTATO ROUND6/5 LB100CS904
3WINDYSPOTATO FRENCH FRY STRAIGHT6/5 LB30CS904

<tbody>
</tbody>






Worksheet Stop 1:

InstitutionStop #DescriptionPack/SizeQtyUOMPO #
MACDONALDS1THICKENER NECTAR FD/BEV200/4.8GRAM4CS278
MACDONALDS1BEAN GREEN GR B *GRADED* C4016/#1016CS3610151
MACDONALDS1BEAN VEGETARIAN SCE*GRADED* C46/#1010CS3610151
MACDONALDS1BEET DICED *GRADED* C401186/1012CS3610151
MACDONALDS1POTATO WHOLE WHITE 60-80 CT C6/#106CS3610151
MACDONALDS1YAM CUT FCY C401186/106CS3610151
MACDONALDS1MUSHROOM PCS & STEMS INDIAM -6/#102CS3610151
MACDONALDS1TOMATO DICED CHO *GRADED* C4016/1010CS3610151

<tbody>
</tbody>
<strike></strike>

<strike></strike>

Thanks for any assistance!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I'd suggest something like this. With your EF Copy sheet defined as you show above, create your Stop 1 sheet to look like this:

ABCDEFGH
1Stop #InstitutionDescriptionPack/SizeQtyUOMPO #Row
21MACDONALDSTHICKENER NECTAR FD/BEV200/4.8GRAM4CS2782
3MACDONALDSBEAN GREEN GR B *GRADED*6/#1016CS36101513
4MACDONALDSBEAN VEGETARIAN SCE*GRADED*6/#1010CS36101514
5MACDONALDSBEET DICED *GRADED* C401184326112CS36101515
6MACDONALDSPOTATO WHOLE WHITE 60-80 CT C6/#106CS36101516
7MACDONALDSYAM CUT FCY C40118432616CS36101517
8MACDONALDSMUSHROOM PCS & STEMS INDIAM -6/#102CS36101518
9MACDONALDSTOMATO DICED CHO *GRADED*4326110CS36101519
10

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Stop 1

Worksheet Formulas
CellFormula
B2=IF($H2="","",INDEX('EF Copy'!B:B,$H2))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
H2{=IFERROR(SMALL(IF('EF Copy'!$A$2:$A$100=$A$2,ROW($A$2:$A$100)),ROWS($H$2:$H2)),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Put the stop number in A2. Then in H2, put that array formula, update the ranges to match your sheet, then confirm with Control+Shift+Enter. Now drag down as far as needed. At this point, you can hide column H if you want. It finds the row numbers of matching rows from EF Copy. I do this one time for efficiency - you really don't want to do the same time-intensive formulas in more than one column if you don't have to. Now put in the B2 formula, and drag across to G and down as far as needed.

Now the nice thing about this is that you can copy these formulas to the other Stop sheets. You just have to change the value in A2. Let us know how this works for you.
 
Upvote 0
Entered these formulas... cells coming up blank.
Triple checked the formulas. Used C+S+E correctly to get the {} brackets.
?? Suggestions ??
 
Upvote 0
Only the H2 formula needs the CSE. If you have ensured that the formula is the same as I created, then the next possibility is that the ranges are different. Start with the H2 formula. Make sure that the ranges are the same (is the stop number on the EF Copy sheet actually in column A?). Is there a value in A2 of the stop sheet? Are the values in EF Copy!A:A text or numeric? Same question for A2? Do you actually start in row 2?
 
Upvote 0
Yes... only H2 = CSE
EF Copy and Stop 1 worksheets are virtual copies of each other. Columns A thru G with row 1 as the title row so all cells match up correctly.
All cells are formatted as "General". This is how they come across from the AS400 query.
 
Upvote 0
It still could be a problem where the values on your EF Copy sheet are text, and the value in the Stop 1!A2 cell is numeric. Even if the cell and/or column is formatted as General, the value in the cell could be text, especially if you populate it from a download. How is the number justified in the A column? Is it on the right or the left of the cell? Numbers will be on the right (like I'd assume your A2 cell is) and text, even if it's a number, will be on the left. If the EF Copy!A column has numbers on the left, you can format the A2 cell as text, then re-enter the 1, and the formula should work. Or we can adjust the formula so that it can handle numbers stored as text.

Let me know if that works, there could be other possibilities.
 
Upvote 0
Both are right justified... I even tried changing the info on the EF Copy by just typing a "1" in the cell. Also tried changing the formatting in the cells for both worksheets from general to text to number.
None of those efforts worked.
 
Upvote 0
Find a cell in column A of EF Copy that has a 1 in it, say A10. Then in A3 of Stop 1 put this formula:

='EF Copy'!A10=A2

If it's FALSE, we still have some kind of format error. If TRUE, then there must be some other problem.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

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