Search code examples
google-sheets

Can I append tags from one sheet to the a column in another sheet based on conditions?


Refer to this file https://docs.google.com/spreadsheets/d/1tVuhFYKXCFXjYTVncfOW79uBo55qhEI6BhdUOkZegOU/edit#gid=79825211

The first sheet has shopify export of my product which has a product handle in column A and tags in column G. The second sheet is a list of handles and tags.

Now I want to check against sheet 2 if the handle is present in sheet 1, append the tag of that row in sheet 1 against the same handle.

for eg, if handle carbon-fiber-antenna is present in sheet 1's handle column, then the tag 20071 SeriesE81 will be added to tags already present in sheet 1 like: interir, exterior, 20071 SeriesE81

The main motive is to add tags to all products so I can import it back to shopify.

I am not able to think of anything


Solution

  • Try This, It will update the "Tags" column (G) in Sheet 1 with the original tags appended with any matching tags from Sheet 2. For handles not found in Sheet 2, the original tags remain unchanged.

    =CONCATENATE(G2:G,", ",XLOOKUP(A2:A,B2:B,C2:C,", "))