Combine two lists

rconverse

Well-known Member
Joined
Nov 29, 2007
Messages
1,187
Hello,

I have list of product IDs and a list of warehouses. The list of product IDs is about 2900 skus. There are 20 warehouses. How can I take those two lists and combine them into one. So, for each product, I'd like it listed by each warehouse. This would mean my product ID list would go from 2900*20.

Thank you!
Roger
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Roger

Where do you have the data?

Are there separate worksheets for each warehouse?
 
Upvote 0
So you have 2 lists?

One with the warehouse IDs and one for the SKUs?
 
Upvote 0
Sku's across and product codes down ... then you can use a formula:

<img alt="worksheet" src="http://northernocean.net/etc/mrexcel/20110615.png" />

Formula in B2 is:
=B$1&"-"&$A2

-------------------------------------------------------------------------------

I'm getting too tired to think of a better solution but for kicks, a vba solution which will give you one long column and crash if you get over 65,536 rows in Excel 2003:

UNTESTED:
Code:
Dim a, b, c
Dim i as Long, j As Long, k As Long

a = Range("A1:A2900").Value
b = Range("B1:B20").Value
Redim c(1 to (Ubound(a,1) * Ubound(b,1)))

For i = 1 to Ubound(a)
    For j = 1 to Ubound(b)
        k = k + 1
        c(k) = a(i) & "-" & b(i)
    Next j
Next i

Range("C1").resize(1 to Ubound(c)).Value = Application.Transpose(c)


-------------------------------------------------------------------------------


For what it's worth I would just import the two worksheets into Access as two tables and run a query: SELECT [SKU] & '-' & [Warehouse] As Warehouse_Sku FROM Table1,Table2;
I think that would also do the trick.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,239
Members
452,898
Latest member
Capolavoro009

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