Forum Discussion
difference between two filtered lists in excel
- Jan 21, 2022
- abrummetJan 21, 2022Copper ContributorAdditionally, I simply embedded the two initial filter functions into the filter and xlookup combo and that worked wonderfully. So this is condensed down into 1 equation. Thanks!
- abrummetJan 21, 2022Copper Contributor
Thanks. I see what you are doing there and that makes sense; however, it doesn't quite work for what I am wanting to do. The xlookup embedded in the filter function is essentially just finding the difference between the two lists with no connection to the number associated with that person. I am trying to find the difference between the two list for everyone that has a certain number associated with them. Meaning, who is a "1" on the first list and who is a "1" on the second list, and now what is the difference between them. Any thoughts on this? Thanks again.
- Riny_van_EekelenJan 21, 2022Platinum Contributor
abrummet But that is exactly what the formula is doing. You asked for a formula that could determine the difference between two list, filtered for the number 1.
You can cut-out the interim steps to make an "all-in-one-formula" like this:
=FILTER(FILTER(B2:B6,C2:C6=1),XLOOKUP(FILTER(B2:B6,C2:C6=1),FILTER(E2:E4,F2:F4=1),FILTER(E2:E4,F2:F4=1),1)=1)Make it easier to read/maintain by using named ranges, rather than direct cell references and a hard-coded numbers 1. Since you are on a recent Excel version, consider using LET to avoid the repeating portions in the formula. But perhaps I have missed your point all-together.
Edit: Didn't see your last two posts until I posted mine.
- abrummetJan 21, 2022Copper Contributorunless I spoke too soon. I see now you did the filter for both and then the embedded xlookup and filter. This works! Thank you and I apologize for the confusion
- Benny_1857Jan 21, 2022Brass ContributorRiny_van_Eekelen
=FILTER(A:A,XLOOUP(A:A,B:B,B:B,X)=X)
Could X be any number? As I test 0,10,100... ^O^- Riny_van_EekelenJan 21, 2022Platinum Contributor
Benny_1857 I guess so. The "X" inside the XLOOKUP is what get's returned when the lookup value is not found. Then, with FILTER you can specify the "X" to be the inclusion criteria.