+ Reply to Thread
Results 1 to 4 of 4

Trying to Find the Top Ten Values and Return a Value from Another Row

  1. #1
    Forum Contributor
    Join Date
    11-23-2013
    Location
    La Crosse, Wi
    MS-Off Ver
    Excel 2010
    Posts
    103

    Trying to Find the Top Ten Values and Return a Value from Another Row

    I have a huge data base (daily temperatures dating back to 1872), but for simplicity I have limited the values to just a month for this question. What I want to do it list the ten warmest temperatures and then return the date in which it occurred. I am using the following LARGE function to get the ten warmest temperatures (Column B - high temperatures).

    =LARGE($B$2:$B$31,$D2)

    Column B = High Temp in Data Table
    Column D = Rank in Results Table

    This works great. However when I use the following Index function to get the date in which it occurred (Column A - Date), it keeps returning the first date in which it occurred when there are multiple occurrences of the same temperature.

    =INDEX($A$2:$A$31,MATCH(LARGE($B$2:$B$31,$D2),$B$2:$B$31,0))

    Column A = Date in Data Table
    Column B = High Temp in Data Table
    Column D = Rank in Results Table

    In some cases, I have more than 2 occurrences of the same temperatures. For example, the high temperature of 23 degrees occurs 3 times during the month (1/4/2013, 1/11/2013, and 1/12/2013), but only the first one 1/4/2013 shows up in my results table. I would like the other dates to show up. These tables are listed below.

    Can anyone help me with this?

    Thanks in Advance for any help on this!

    Jeff Boyne


    Data Table Results Table
    Date High Temp Rank High Temp Date
    1/2/2013 1 1 27 1/5/2013
    1/3/2013 17 2 23 1/4/2013
    1/4/2013 23 3 23 1/4/2013
    1/5/2013 27 4 23 1/4/2013
    1/6/2013 19 5 22 1/13/2013
    1/7/2013 18 6 22 1/13/2013
    1/8/2013 2 7 19 1/6/2013
    1/9/2013 5 8 18 1/7/2013
    1/10/2013 8 9 17 1/3/2013
    1/11/2013 23 10 17 1/3/2013
    1/12/2013 23
    1/13/2013 22
    1/14/2013 17
    1/15/2013 22
    1/16/2013 9
    1/17/2013 8
    1/18/2013 -4
    1/19/2013 -7
    1/20/2013 -9
    1/21/2013 1
    1/22/2013 4
    1/23/2013 2
    1/24/2013 6
    1/25/2013 8
    1/26/2013 9
    1/27/2013 -2
    1/28/2013 7
    1/29/2013 16
    1/30/2013 6
    1/31/2013 8

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Trying to Find the Top Ten Values and Return a Value from Another Row

    see attached for 2 ways
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    11-23-2013
    Location
    La Crosse, Wi
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Trying to Find the Top Ten Values and Return a Value from Another Row

    Thanks...never used a pivot table. Do these update when you add new data?

    Thanks again!

    Jeff B

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Trying to Find the Top Ten Values and Return a Value from Another Row

    probably the best way would be to use a table
    select
    beginning to and of data say a2:b1000
    then on the insert tab choose table
    it should show a create table window
    showing the range ,choose my table has headers if you need to
    this will automatically be called table1
    now when you create pivot table
    use table1 as source data
    now when you add to end of table the table should expand automatically to include the new data
    simply right click the pivot table and refresh

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to find closest values in multiple columns and return adjacent values.
    By Patrician in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-28-2013, 01:47 PM
  2. [SOLVED] Find a values from within a column then return a value
    By tearl42 in forum Excel General
    Replies: 2
    Last Post: 07-02-2012, 06:11 PM
  3. Find and return Top n Values
    By praetorianprefect in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2011, 01:51 PM
  4. Find if values are between ranges and return code and values
    By ozzbaldo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2007, 09:52 AM
  5. find largest values, then return corresponding row values.
    By neurotypical in forum Excel General
    Replies: 7
    Last Post: 05-24-2006, 05:27 PM

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