+ Reply to Thread
Results 1 to 11 of 11

Extracting Data Top 5

  1. #1
    Registered User
    Join Date
    04-28-2016
    Location
    London
    MS-Off Ver
    2007
    Posts
    48

    Extracting Data Top 5

    Hello, I wonder if anyone could help me.

    I have columns A,B,C with the date, name and a value respectively. I am trying to extract the data between 2 dates and then list the top 5 highest to lowest in column D. Can anyone help ? Thanks

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extracting Data Top 5

    Post a SMALL sample file (no more than 20 rows worth of data) and show us what results you expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    04-28-2016
    Location
    London
    MS-Off Ver
    2007
    Posts
    48

    Re: Extracting Data Top 5

    Date Name Percentage
    16 04 16 Peter 66%
    13 04 16 Bob 80%
    21 04 16 Andre 99%
    17 04 16 Lucy 12%
    27 04 16 Gordon 36%
    15 04 16 Terry 14%
    17 04 16 Lisa 23%
    26 05 16 Sally 75%
    23 04 16 Maggie 26%
    23 04 16 Allen 95%
    18 04 16 Linda 57%


    Date: 13 04/16- 22/04/16

    RESULTS:

    TOP 5
    Andre 99%
    Bob 80%
    Peter 66%
    Linda 57%
    Lisa 23%

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Extracting Data Top 5

    With dates in E1 and F1 and data in A:C

    in E2

    =IF(($A$2:$A$12>=$E$1)*($A$2:$A$12<=$F$1),(LARGE(($A$2:$A$12>=$E$1)*($A$2:$A$12<=$F$1)*($C$2:$C$12),ROWS($1:1))))

    Enter with Ctrl+Shift+Enter and copy down

    In F2

    =INDEX($B$2:$B$12,MATCH($E2,$C$2:$C$12,0)) copy down

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extracting Data Top 5

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    4/16/2016
    Peter
    66%
    4/13/2016
    4/22/2016
    Andre
    99%
    2
    4/13/2016
    Bob
    80%
    Bob
    80%
    3
    4/21/2016
    Andre
    99%
    Peter
    66%
    4
    4/17/2016
    Lucy
    12%
    Linda
    57%
    5
    4/27/2016
    Gordon
    36%
    Lisa
    23%
    6
    4/15/2016
    Terry
    14%
    7
    4/17/2016
    Lisa
    23%
    8
    5/26/2016
    Sally
    75%
    9
    4/23/2016
    Maggie
    26%
    10
    4/23/2016
    Allen
    95%
    11
    4/18/2016
    Linda
    57%
    12
    ------
    ------
    ------
    ------
    ------
    ------
    ------
    ------


    Enter this array formula** in H1 and copy down to H5:

    =LARGE(IF(A$1:A$11>=E$1,IF(A$1:A$11<=F$1,C$1:C$11)),ROWS(H$1:H1))

    Format as %

    Enter this array formula** in G1 and copy down to G5:

    =INDEX(B:B,SMALL(IF(A$1:A$11>=E$1,IF(A$1:A$11<=F$1,IF(C$1:C$11=H1,ROW(B$1:B$11)))),COUNTIF(H$1:H1,H1)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    I made the assumption that there will always be at least 5 data points that fall within the date range.

  6. #6
    Registered User
    Join Date
    04-28-2016
    Location
    London
    MS-Off Ver
    2007
    Posts
    48

    [Solved] Extracting Data Top 5

    Exactly what I wanted, thank you very much.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: [Solved] Extracting Data Top 5

    You're welcome. Thanks for the feedback!

  8. #8
    Registered User
    Join Date
    04-28-2016
    Location
    London
    MS-Off Ver
    2007
    Posts
    48

    Re: Extracting Data Top 5

    Building on top of this formula, how can I ignore any figures that say 100%.

    Date Name Percentage
    16 04 16 Peter 66%
    13 04 16 Bob 100%
    21 04 16 Andre 100%
    17 04 16 Lucy 12%
    27 04 16 Gordon 36%
    15 04 16 Terry 14%
    17 04 16 Lisa 23%
    26 05 16 Sally 75%
    23 04 16 Maggie 26%
    23 04 16 Allen 95%
    18 04 16 Linda 57%
    14 04 16 Greg 21%
    15 04 16 Lulu 20%


    Results

    TOP 5
    Peter 66%
    Linda 57%
    Lisa 23%
    Greg 21%
    Lulu 20%

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extracting Data Top 5

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    4/16/2016
    Peter
    66%
    4/13/2016
    4/22/2016
    Peter
    66%
    2
    4/13/2016
    Bob
    100%
    Linda
    57%
    3
    4/21/2016
    Andre
    100%
    Lisa
    23%
    4
    4/17/2016
    Lucy
    12%
    Greg
    21%
    5
    4/27/2016
    Gordon
    36%
    Lulu
    20%
    6
    4/15/2016
    Terry
    14%
    7
    4/17/2016
    Lisa
    23%
    8
    5/26/2016
    Sally
    75%
    9
    4/23/2016
    Maggie
    26%
    10
    4/23/2016
    Allen
    95%
    11
    4/18/2016
    Linda
    57%
    12
    4/14/2016
    Greg
    21%
    13
    4/15/2016
    Lulu
    20%


    This array formula** entered in H1:

    =LARGE(IF(A$1:A$13>=E$1,IF(A$1:A$13<=F$1,IF(C$1:C$13<1,C$1:C$13))),ROWS(H$1:H1))

    Format as Percentage

    This array formula** entered in G1:

    =INDEX(B:B,SMALL(IF(A$1:A$13>=E$1,IF(A$1:A$13<=F$1,IF(C$1:C$13<1,IF(C$1:C$13=H1,ROW(B$1:B$13))))),COUNTIF(H$1:H1,H1)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Select G1:H1 and copy down to G5:H5

  10. #10
    Registered User
    Join Date
    04-28-2016
    Location
    London
    MS-Off Ver
    2007
    Posts
    48

    Re: Extracting Data Top 5

    thanks so much!

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extracting Data Top 5

    You're welcome!

+ 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. Replies: 1
    Last Post: 02-02-2015, 11:47 AM
  2. [SOLVED] Counting specific data and extracting that data by rearranging by assigning numbering
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-25-2014, 07:11 AM
  3. Extracting data from file in directory and extracting filename
    By brad999 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2014, 11:21 AM
  4. Replies: 0
    Last Post: 10-25-2013, 12:14 PM
  5. Replies: 1
    Last Post: 09-10-2013, 09:24 AM
  6. Replies: 7
    Last Post: 05-31-2012, 11:24 AM
  7. Extracting data from one massive worksheet to split to smaller sheets of data
    By michaelkwc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-21-2008, 06:35 AM

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