PL said:
.. need to capture those duplicate data with the conditions of:
Same date, same time, same room
Here's a non-array formulas set-up which can dynamically drive out either a
list of unique lines, or a list of the duplicate lines from the source data.
The former -- a list of unique lines -- is perhaps the more important list.
Assume source data is in sheet: X,
cols A to C, data from row2 down, eg:
Date Time Room
02-09-2006 9am-6pm 105
03-09-2006 9am-6pm 102
04-09-2006 9am-6pm 100
02-09-2006 9am-6pm 105
03-09-2006 9am-6pm 102
04-09-2006 9am-6pm 100
03-09-2006 9am-6pm 102
02-09-2006 9am-6pm 105
Extracting a list of unique lines from X
In a new sheet: Y,
Paste the same col headers into B1
1 :
Date, Time, Room
Put in A2:
=IF(COUNTA(X!A2:C2)<3,"",IF(SUMPRODUCT((X!$A$2:A2=X!A2)*(X!$B$2:B2=X!B2)*(X!$C$2:C2=X!C2))>1,"",ROW()))
(Leave A1 empty)
Put in B2:
=IF(ROW(A1)>COUNT($A:$A),"",INDEX(X!A:A,MATCH(SMALL($A:$A,ROW(A1)),$A:$A,0)))
Copy B2 to D2
Then just select A2
2 and copy down to cover the max expected extent of
source data in X. Format col B as dates. Hide away col A or mask the font in
white. Cols B to D will return the uniques list dynamically from X, with all
results neatly bunched at the top, viz:
Date Time Room
02-09-2006 9am-6pm 105
03-09-2006 9am-6pm 102
04-09-2006 9am-6pm 100
If we want to extract the list of duplicate lines from X instead,
just tweak the criteria formula in A2 to:
=IF(COUNTA(X!A2:C2)<3,"",IF(SUMPRODUCT((X!$A$2:A2=X!A2)*(X!$B$2:B2=X!B2)*(X!$C$2:C2=X!C2))>1,ROW(),""))
and copy A2 down. Rest of construct remains unchanged.
[just swap the ROW() and "" returns around in the 2nd IF]
For the sample data, we'd then get:
Date Time Room
02-09-2006 9am-6pm 105
03-09-2006 9am-6pm 102
04-09-2006 9am-6pm 100
03-09-2006 9am-6pm 102
02-09-2006 9am-6pm 105
---