Look at this screenshot
Rows remain locked together.
I split column A into two columns so that cells of column A contain dates.
In cell J2, the formula is :
=IF(LEN($A)=0,"X",""&YEAR($A)&RIGHT("0"&MONTH($A),2)&RIGHT("0"&DAY($A),2)&$B&"_" &$F)
In cell K2, the formula is :
=IF(LEN($A)=0,"X",IF(LEN(F)=0,OFFSET($F$1,ROW(),0)&"
",F)&""&YEAR($A)&RIGHT("0"&MONTH($A),2)&RIGHT("0"&DAY($A),2)&$B)
In cell L2, the formula is :
=IF($J2="X","",IF(COUNTIF($J,$J2)>1,"duplicate",""))
Then, apply Fill Down.
As you may see, when a row doesn't contain a record, the key is not set to "" but to "X" so that it remain at the bottom when we sort.
Of course, the formula flagging duplicate doesn't flag these 'empty' rows.
Yvan KOENIG (VALLAURIS, France) mercredi 9 mars 2011 12:03:21