+ Reply to Thread
Results 1 to 6 of 6

Index and Match, Don't Want Duplicates

  1. #1
    Forum Contributor
    Join Date
    11-22-2003
    Location
    Newport, Rhode Island
    MS-Off Ver
    2021
    Posts
    154

    Index and Match, Don't Want Duplicates

    Hello Everyone,
    Using Excel 2010 and Windows 7.

    Attached is a worksheet that has the 31 days of July on the top and on the far left years 2012 to 2000 that have the daily average temperature for July.

    I am looking to find the five highest and five lowest temperatures for the day (in this case July 21st) and match the temperatures with the year of occurances. In cases where two temperatures are the same, the latest year shows correctly but also shows up in the the next match, which is incorrect. It should show the the next latest year.

    In the attached sample spreadsheet I explain the ranges the of the dates and years and show the formula to find the five highest and five lowest temperature for today and the corresponding year.

    I am looking for a forumula that will fix the duplicate year showing up when two or more temperature from today are the same.

    Thanks for any help.
    Attached Files Attached Files

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Index and Match, Don't Want Duplicates

    The easiest way to achieve this is to use a helper table, this can be hidden, for example with a grouping button.

    In AN2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    To check the duplicates for 21/7 (yesterday) temporarily change this to
    =MATCH(TODAY()-1,B2:AF2,0) or just 21

    See this workbook for the remaining formulae.
    Attached Files Attached Files
    Last edited by Marcol; 07-22-2012 at 04:15 AM. Reason: Further explanation added
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Contributor
    Join Date
    11-22-2003
    Location
    Newport, Rhode Island
    MS-Off Ver
    2021
    Posts
    154

    Re: Index and Match, Don't Want Duplicates

    Hi Marcol,
    Thanks so much, it works but I would like to tweak it when two or more temperatures are identical, sometimes it puts the matching year in ascending order, i would like it to be in decending order, like this:
    now:
    84.0 2007
    84.0 2010
    would like it to have the year in decending order like this:

    84.0 2010
    84.0 2007
    Thanks.
    Last edited by windme; 07-22-2012 at 01:02 PM. Reason: spelling

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Index and Match, Don't Want Duplicates

    Okay we just reverse the order of the COUNTIF() counter
    In AD3 old formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    New formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Two points to note.
    1/. In the starting formula AN3:AN$15 covers your table depth.
    If you have more rows, say going back another 5 years, then the starting range will be AN3:AN$20
    Note that the last cell is now your anchor.

    2/.Your data has an indeterminate number of decimal points, Excel will only display up to 16 digits including any decimal point, formatting for any more will only display additional zeros.

    It might be possible that by adding the tie-breaker,some numbers could be wrongly promoted.
    To minimize this possibility I've decreased the added counter from n/100 to n/10^9

    Better that you decide on how many significant figures you need and round either the source data or the helper (column AN) accordingly.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    11-22-2003
    Location
    Newport, Rhode Island
    MS-Off Ver
    2021
    Posts
    154

    Re: Index and Match, Don't Want Duplicates

    Thanks Marcol for your help. After applying the new formula I noticed that in case of identical temperatures, it correctly sorts the years in decending order only in the minimum values but not the maximum values. Not sure if we can give the maximum values a different formula to reflect that.

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Index and Match, Don't Want Duplicates

    Oops, missed that!

    Okay, the easiest way to handle that, I hope, is to use seperate tie-breaker columns for Large and Small
    In AO3 (Latge)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In AP3 (Small)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You can now disregard point 1 in post #4

    See this workbook for the range reference changes in the Results Table.
    Attached Files Attached Files
    Last edited by Marcol; 07-24-2012 at 09:46 AM.

+ 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