+ Reply to Thread
Results 1 to 8 of 8

Sorting Dates MonthWise and getting Unique Values

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Sorting Dates MonthWise and getting Unique Values

    Sorting Dates MonthWise and getting Unique

    I had already got a solution on a similar query last week from the great DO..

    http://www.excelforum.com/excel-work...ly-months.html

    with the Query : Is Multilookup possible alongwith LIKE SORTING for only MONTHS..

    However now though I have got the monthwise sort done is it possible to also get only the Unique Values..
    In the otherquery I was pulling data for all the Dates but now I need to just get One MOnth -> for all the Policies.

    Already have a few helper columns which I was already using to get the Unique values but dont know how to sort them or Sort them and also get Unique values...

    In another sheet i need to get a Dropdown of only those MOnths which are relevant for a Particular person..

    Please find the same file but just refer the Sheet "Rishi K".

    Regards
    E
    Attached Files Attached Files
    Last edited by e4excel; 01-05-2011 at 02:07 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sorting Dates MonthWise and getting Unique Values

    Assuming you intend to maintain your existing helper cells then:

    Please Login or Register  to view this content.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sorting Dates MonthWise and getting Unique Values

    I inadvertently deleted your reply to the above post in which you stated

    Quote Originally Posted by madeup
    "this works - great - but could we do it without using C & D ?"
    (I deleted it whilst I was moving your other post from this thread to the transpose thread!)

    Anyway, yes, you could but it would be quite ugly - or at least given the way my brain is presently functioning it would be.

    First, you should really use at least one helper...to minimise array execution:

    Please Login or Register  to view this content.
    the above gives you the unique month count of those dates deemed valid based on YLY criteria (you could also use a Frequency Array)

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Sorting Dates MonthWise and getting Unique Values

    Thanks once again DO, thats ok for deleting the thread..

    Even I erroneously it seems had posted a reply to some other thread..

    Code:
    V2:
    =IF(ROWS(V$2:V2)>$X$1,"",DATE(YEAR(TODAY()),MIN(IF(($J$2:$J$15="YLY")*ISNUMBER($F$2:$F$15),IF(ISNA(MATCH(MONTH($F$2:$F$15),MONTH($V$1:$V1),0)),MONTH($F$2:$F$15)))),1))
    confirmed wtih CTRL + SHIFT + ENTER (note Enter alone will not suffice)
    copied down to V15
    I tried this it does not work it gives an invalid month with the order as
    1-Dec-2010
    1-Jan-2011
    1-Feb-2011
    1-Jun-2011

    Instead of the correct order from your ISt solution..
    1-Jan-2011
    1-Feb-2011
    1-Jun-2011
    1-Jul-2011

    Regards
    E

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sorting Dates MonthWise and getting Unique Values

    I didn't test with text header... one possibility (there are plenty)

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Sorting Dates MonthWise and getting Unique Values

    Wow this is the best one If I combine the value in X1 in the last code then I get the direct results..

    Simply amazing..

    I have not been able to figure out the formuls till now..

    The role of "@" in the X! and N(V1) TILL NOW..

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sorting Dates MonthWise and getting Unique Values

    Quote Originally Posted by e4excel View Post
    Wow this is the best one If I combine the value in X1 in the last code then I get the direct results..
    If you're saying you are embedding X1 into the V2:V15 formulae (so as to remove the helper) then that's a (very) bad thing to do if efficiency of calculations is even of remote interest to you.

    Repeating calculations where result is constant is one of the first things you should look to avoid.
    Where the calculation being repeated is expensive (as is the case here) this practice would be deemed (at best) naive.

    edit: generally speaking (though not always by any means) where we advise using a helper cell (or cells) it's for good reason.
    Last edited by DonkeyOte; 01-06-2011 at 05:00 AM.

  8. #8
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Sorting Dates MonthWise and getting Unique Values

    Quote Originally Posted by DonkeyOte View Post
    Repeating calculations where result is constant is one of the first things you should look to avoid.

    edit: generally speaking (though not always by any means) where we advise using a helper cell (or cells) it's for good reason.
    No no I just tried doing it but I was anyways not going for that..
    But as per your suggestions, I am not going to incline on non-helper codes..as I totally agree that repeating calcualtions would not be a good idea..rendering the code slow..and complex to refer at a later stage..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1