+ Reply to Thread
Results 1 to 6 of 6

How to lookup last five values in two columns.

  1. #1
    Registered User
    Join Date
    01-01-2020
    Location
    Japan
    MS-Off Ver
    2019
    Posts
    4

    How to lookup last five values in two columns.

    Hi,all
    I have some data like this. I want to lookup letter "a" from column A and B, and I only want the last five results "a" appears. How can I get the results in 5 cells using functions. Thanks a lot!
    a b 1
    c a 2
    b c 3
    a d 4
    b c 5
    d b 6
    d a 7
    a c 8
    a g 9
    g b 10
    (data)


    c a 2
    a d 4
    d a 7
    a c 8
    a g 9
    (results)
    Last edited by Megumi; 01-04-2020 at 12:02 PM.

  2. #2
    Registered User
    Join Date
    01-01-2020
    Location
    Japan
    MS-Off Ver
    2019
    Posts
    4

    Re: How to lookup last five values in two columns.

    Anyone??

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: How to lookup last five values in two columns.

    =iferror(index(a$1:a$10,aggregate(15,6,$c$1:$c$10/(($a$1:$a$10=$f$1)+($b$1:$b$10=$f$1)),sumproduct(--(($a$1:$a$10=$f$1)+($b$1:$b$10=$f$1)))-5+rows($a$1:a1))),"")
    Attached Files Attached Files

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to lookup last five values in two columns.

    With your data on A1:C10 use

    =INDEX(A$1:A$10,LARGE(INDEX(($A$1:$B$10="a")*(ROW($A$1:$A$10)),0),6-ROW($A1)))

    Copy down and across

    how-to-lookup-last-five-values-in-two-columns-vbn.xlsx
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Registered User
    Join Date
    01-01-2020
    Location
    Japan
    MS-Off Ver
    2019
    Posts
    4

    Re: How to lookup last five values in two columns.

    Thanks you!

  6. #6
    Registered User
    Join Date
    01-01-2020
    Location
    Japan
    MS-Off Ver
    2019
    Posts
    4

    Re: How to lookup last five values in two columns.

    Thank you!

+ 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. [SOLVED] lookup the intersection of a single column value and a column defined by 2 values
    By mosesthetank in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-15-2018, 01:38 PM
  2. [SOLVED] Lookup two column for matches and return largest values from third column
    By abulkhairi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-13-2017, 01:54 AM
  3. Replies: 15
    Last Post: 09-09-2015, 08:42 PM
  4. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  5. Replies: 11
    Last Post: 07-08-2013, 11:47 AM
  6. lookup values in table, return sum of values from first column
    By owenkam in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-10-2010, 05:20 AM
  7. Lookup multiple values in same column with same column heading
    By kcasey1318 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-10-2010, 05:13 PM

Tags for this Thread

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