Question

I have a Google sheet that has two sets of six columns each. Each set is imported with the importrange function from two different spreadsheets that are fed by their own Google webforms. What I've trying to do without success is to compare at once multiple "pairs" of columns for matching cell contents. Here goes the example with working data:

Paid on behalf of customers

Address              Person            Service      Invoice#   $$    Payment date
50 Rodeo Drive       Elton John        Water        10        100   9/07/2013
678 California St    Robert DeNiro     Electricity  15        120   10/07/2013
345 Dalton Rd        Sylvester Stall1  Cable TV     23        45    11/07/2013
9876 Knoxville St    Al Pacino         Water        42        98    12/07/2013

Recovered from customers

Address             Person             Service      Invoice #   $$     Payment date
50 Rodeo Drive      Elton John         Water        10          100    9/07/2013
678 California St   Robert De Niro     Electricity  15          120    10/07/2013

My question is How to compare each pair of columns altogether (i.e. column "Address" in the first dataset with the column "Address" in the second dataset, and so forth. The aim is to get a third dataset with "only" the recovered invoices, displaying the related data as well (person name, service paid and recovered, invoice #, amount payed and payment date. Is there a formula/function/google apps script or a combination of them to perform this task? I tested with =ArrayFormula(if(len(D3:D);if(isnumber(match(D3:D;K3:K;0));"Recovered";"Pending");iferror(1/0))) but I can only check if there's a match between two columns and show a flag. I mean, I want to check if there are multiple matches before showing a result.

Thanks in advance!

Was it helpful?

Solution

You can try the following:

=filter(Paid!A:F, countif(Recovered!A:A,Paid!A:A))

This will filter the Paid list to show only those entries that are both on the Paid list and the Recovered list (possibly more than once) matching only one column, in this case column A of both.

If you need to filter upon more than one column, you can try something like:

=filter(Paid!A:E, countif(Recovered!A:A&Recovered!B:B&Recovered!D:D,     Paid!A:A&Paid!B:B&Paid!D:D))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top