Google Sheets – Translating Excel ConcatIf to CONCAT Formula

google sheets

I have an inventory spreadsheet created in really old Excel (2000!) with two pages; Inventory and Master. Everything looks fine in Google Sheets, until it comes to the ConcatIf argument on my Master page. The second page calls for words from the first page, using a fairly simple concatenation argument. Here is the formula for the first row on the Master page:

=ConcatIf(Inventory!A:A,"*"&Master!A4&"*",Inventory!B:B,", ")

It is matching the name on line 4 in Master with the name in Inventory on column A, then drawing out the words related to that name, found in column B of Inventory, and returning them as a list.

When I look at this spreadsheet in Google Sheets, the results on the Master page fail. It says I'm using four arguments, when only two are expected.

How can that formula be translated to CONCAT? I'm not a master of this language, the formula was written for me by one.

Some clarification:

This is about a spreadsheet for people and the names of photographs related to them.
Inventory page has column A with various person's names, and column B with the names of images they appear in. Personal names are frequently repeated.

Master has column A with all personal names in alphabetical order, and column B seeks to concatenate all the image names relevant to the person named in A. For every name in Master A, there will be corresponding instances in Inventory A. I'm just trying to gather all the image names from Inventory B to Master B.

So concatenate still seems like the answer to me. It's only a question of translating it from Excel to Google.

Here is a link to an example spreadsheet created in Google, using the formula suggested by zaq. https://docs.google.com/spreadsheets/d/1kfxHnm5nHHrwLBCFCGLxoyuBqEFKj1l_AqCzIcVFYew/edit?usp=sharing

Best Answer

This is more dynamic if you also use regex instead of wildcards as the specific way in which you're using the wildcard is different in Google Sheets compared to Excel .... but this works:

=join(", ", filter(Inventory!B:B, istext(regexextract(Inventory!A:A,Master!A2))))

enter image description here

Note: you should also finally wrap your whole function with =iferror() so that you don't have to see that ugly #N/A when there are no matches... secondly, occasionally I convert everything to lowercase inside of the matching portion of the formula so as to avoid any one of many complications that can happen when you user generated content or input.

That would end up looking like this:

=iferror(join(", ", filter(Inventory!B:B, istext(regexextract(arrayformula(lower(Inventory!A:A)),lower(Master!A2))))))

enter image description here