I need to have excel count the number of times number pairs occur in the same row regardless of their order. The following is what I'm look for. Column C will display the number of times A & B contain the same numbers, but not necessarily in the same columns (or order). Example below: 6 2 and 2 6 should be considered the same thing. Therefore the count in Column C should = 2 for both 6 2 and 2 6.
My Objective:
I tried the pivot table suggested at the following link and it successfully counted matching pairs, but for example 6 2 and 2 6 were not considered the same and the count was only 1 for each.
This simple pivot table solution almost works
Thank you! They all seem to work, but the easiest solution I found was here Quick to copy for large data
使用您发布的SuperUser中的解决方案 ,但使用:
=CONCATENATE(MAX(A2:B2),MIN(A2:B2))
I'm trying to think of a single - formula solution using COUNTIFS
but can't find one at the moment so here's a two formula version.
In column D =IF(A2<B2,A2&", "&B2,B2&", "&A2)
In column C =COUNTIF(D:D, D2)
This creates a list in column D with the following logic;
If A < B then A goes first
If A > B then B goes first
If A = B then B goes first but it doesn't really matter
The list will be a set of strings which we then count.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.