Combine matching data in new column

jamobe

New Member
Joined
Dec 23, 2014
Messages
36
Office Version
  1. 365
Platform
  1. Windows
Hi

I'm hoping someone can help me find a solution. I am trying to figure out how I can achieve the results below. Where there is a matching ASIN in column B and has the fulfillment of FBA, I would like this SKU in column A to then be entered into a new column 'LINKED SKU' so it is matched with the FBM SKU. The desired result is below. I'm racking my brains trying to figure this out and hope someone can help me please. I hope this makes sense. Many Thanks!!

SKUASINFulfillment
SKU11234FBM
SKU1A1234FBA
SKU25678FBM
SKU2A5678FBA
Desired Result
SKULINKED SKUASIN
SKU1SKU1A1234
SKU2SKU2A5678
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I think you would just merge two queries using the ASIN number. The first query only includes FBA items, and the second excludes them.
 
Upvote 0
from the small sample data, this should work for what you're trying to do.
---------------
Book1
ABCDEFG
1SKUASINFulfillmentSKULINKED SKUASIN
2SKU11234FBMSKU1SKU1A1234
3SKU1A1234FBASKU2SKU2A5678
4SKU25678FBM
5SKU2A5678FBA
Sheet1
Cell Formulas
RangeFormula
F2:F3F2=IF(MATCH(G2,B$1:B$5,0)>1,XLOOKUP(G2,B$1:B$5,A$1:A$5,"na",0,-1),"")
 
Upvote 0
This will work if the names of the linked SKUs are always longer than the primary SKU name.

Power Query:
let
    Source = Table.AddColumn(Excel.CurrentWorkbook(){[Name="Table1"]}[Content], "Sort Col", each Text.Length(_[SKU])),
    Group = Table.Group(Source, {"ASIN"}, {{"Linked SKU", each 
        let t = Table.Sort(_,{{"Sort Col", Order.Ascending}}) in {t[SKU]{0}} & {Table.SelectRows(Table.Skip(t,1),(x)=> x[Fulfillment]="FBA")[SKU]}}}),
    tbl = Table.AddColumn(Group, "SKU", each _[Linked SKU]{0}),
    tbl1 = Table.TransformColumns(tbl, {"Linked SKU", each Text.Combine(List.Transform(_{1}, Text.From), ", "), type text}),
    Result = Table.ReorderColumns(tbl1, List.Reverse(Table.ColumnNames(tbl1)))
in
    Result

PQ linked SKU.xlsx
ABCDEFGH
1SKUASINFulfillmentSKULinked SKUASIN
2SKU11234FBMSKU1SKU1B, SKU1A1234
3SKU1A1234FBASKU2SKU2A5678
4SKU1B1234FBASKU32468
5SKU25678FBMSKU4SKU4A1357
6SKU2A5678FBA
7SKU32468FBM
8SKU3A2468
9SKU4A1357FBA
10SKU41357FBM
11
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,865
Messages
6,121,988
Members
449,060
Latest member
mtsheetz

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