google-sheetsgoogle-sheets-formulaspreadsheet

How do i check for & filter by multiple unique arguments in google sheets?


I currently am majually going through Google Sheet spreadsheets that include peoples' names, and charitable groups they've donated to, with each donation being a new line. I am currently trying to find a way to easily isolate just people who have donated to 2 or more charities, so i would need to use a formula/function that checks for unique names, and then searches rows with each unique name and shows/isolates/sorts only the rows where a specific individual has donated to more than one charity. The issue is that in many many cases, people donate to the same charity twice, so it can't just be # of instances of a given unique name.

I've attached a sample sheet that has all the info replaced with anonomized info but its effectively the same setup, plus an example of what data i want seperated. https://docs.google.com/spreadsheets/d/1heECQb9D9TzCAjQsU8-Ij1wUI-cZOsK-N3LXAGX3-Fo/edit?usp=sharing

Thank you in advance!


Solution

  • You may try:

    =filter(A2:R25,let(Σ,Q2:Q25,xmatch(Σ,reduce(,unique(Σ),lambda(a,c,vstack(a,if(countuniqueifs(B2:B25,Σ,c)>1,c,)))))))
    

    enter image description here