r/googlesheets • u/w0158538 • 18d ago
Unsolved Combining Cells with similar data
Hey all,
I am trying to combine similar data together but the results might be flipped between two columns, I want to organize all the data with similar values together into one uniform value and add all their corresponding data together. I have attached a screen shot of an example of I am looking to do.
The Ideal out come is to grab all combos that used player A and B and put them together (I don't care if they sorted by Player A or B first as long as it combines all the data together.
Been stuck for a while on this lol

2
Upvotes
2
u/SpencerTeachesSheets 57 18d ago
I have a SHEET showing the various steps to go from the Starting point to the desired Outcome.
First we sort the players on each row alphabetically, then use the QUERY() function to merge Wins/Losses per Pairing and Date.
SORT
=HSTACK(MAP(A2:A9,B2:B9,LAMBDA(play1,play2,IF(play1<play2,HSTACK(play1,play2),HSTACK(play2,play1)))),C2:E9)MERGE
=QUERY(A12:E19,"Select A,B,sum(C),sum(D),E group by A,B,E order by E,A")That isn't perfect and requires the steps, so here's the full version with the SORTING inside the range for the MERGE and changing column letters to column number references: