• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sort unique distinct dates from a range of dates

ojaskulkarni

New Member
Hi,

I have table (Excel Table) with a column of multiple dates. These are record creation dates.
The range of dates is for a specified fiscal year. (say, April 1, 2013 to March 31, 2014)

I want to make a list (for data validation) that will do the following:
1. Build an array of unique distinct dates
2. Build an array of only dates that occur on a Tuesday.

The reason I say an "array" is because I want it to be dynamic and expandable. The drop down (data validation) will be used to display another set of related information. But the drop down should have only unique distinct Tuesdays available for selection.
I tried various combinations of INDEX-MATCH and OFFSET etc.. but it doesn't seem to work.

{=INDEX(Data[Creation Date],MATCH(0,COUNTIF($A$1:A1,Data[Creation Date]),0))} this returns a 0.

Data is the TABLE
Creation Date is the field in the table that has about 1400+ dates.

I also tried WEEKDAY(Data[Creation Date],13) within OFFSET to get a range of Tuesdays from the range of dates.

Can someone help?

Thanks,
Ojas
 
@ojaskulkarni

Yes you can do it. See the attached.

But I had copied the formula quite a few long range with dynamic drop down list, which will take care of this.

Regards,

Hi Somendra,

I changed the formula to this below on a new sheet and it works perfect...

=IFERROR(INDEX(Data[Creation Date],SMALL(IF(FREQUENCY(IF(WEEKDAY(IF(Data[Creation Date]>=MIN(Data[Creation Date]),IF(Data[Creation Date]<=MAX(Data[Creation Date]),Data[Creation Date])),2)=2,Data[Creation Date]),Data[Creation Date]),ROW(Data[Creation Date])-ROW('Data'!$K$2)+1),ROWS(A$2:A2))),"-")

'Data'!$K$2 is the first date cell of the column [Creation Date] in the table [Data] (Sheet name is also 'Data')

The sort for the results change if I sort the original table [Data] by the column [Creation Date].

How can I have the list always show the latest date first?
 
Back
Top