Search code examples
excelexcel-formulaexcel-2013

Pair columns A and B, get the matching data in C considering doubled values for different users


I have columns "Manifestos A" and "Manifestos B" (with its correspondent "volumes"). "A" has more than 1000 lines and "B" around 800, so its impossible doing by hand.

Column "Manifestos C" must have the results of "A" > "B" matching and pairing, and add blank cells where there is no match .

This was done before here and was all OK until I found out that some cells might have the same values in columns "A" and "B". I did not foresaw this.

I've made an example to show what happened when I applied the answer I got to my other question:

worksheet showing 3 tables with 3 column each (User, Manifesto and Volumes), with duplicate Manifesto values highlighted in all tables and duplicate volumes for same manifestos in column "Volumes C", showing the error

Note that the pairing is perfectly fine, but the "Volumes C" cells are being repeated from the volumes coupled up with the first "17616" manifesto cell on column "Manifestos B", and this cannot happen.

The formula for cell K3 and bellow:

=IF(NOT(ISERROR(MATCH(C3,G$3:G$15,0))),C3,"")

And for cell L3 and bellow

=IFERROR(VLOOKUP(K3,G$3:H$15,2,0),"")


Now I have to add the "User" filter to the equation so I can get the expected results below:

worksheet showing 3 tables with 3 column each (User, Manifesto and Volumes), with duplicate Manifesto values highlighted in all tables and distinct volumes for same manifestos in column "Volumes C", showing the expected result


Solution

  • you could try this formula in "L3" and copy it down:

    =SUMIFS($H$3:$H$15;$F$3:$F$15;J3;$G$3:$G$15;K3)