+ Reply to Thread
Results 1 to 4 of 4

Find the Last Occurrence of a Lookup Value between two columns

  1. #1
    Registered User
    Join Date
    11-12-2021
    Location
    Illinois
    MS-Off Ver
    2020
    Posts
    2

    Find the Last Occurrence of a Lookup Value between two columns

    Hello, In the attached data file I am trying to return each teams most recent margin of victory from their last game and put them in columns G and H. So for cell g2, I would like the value of F31 returned as this is the last game that denver played. For cell h2, I would like the value of f26 returned as this is the away team's last game. It doesn't matter if the last game is home or away, it just needs to be the most recent game. Any help would be greatly appreciated! Thank you!
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Find the Last Occurrence of a Lookup Value between two columns

    You can use these array* formulae in the cells stated:

    G2: =IFERROR(1/(1/INDEX(F:F,MIN(IF((B3:B$98=B2)+(C3:C$98=B2),ROW(B3:B$98),100)))),"")

    H2: =IFERROR(1/(1/INDEX(F:F,MIN(IF((B3:B$98=C2)+(C3:C$98=C2),ROW(B3:B$98),100)))),"")

    *NOTE that if you are not using XL365, then you will need to commit these formulae using the key combination of Ctrl-Shift-Enter (CSE), rather than the usual Enter.

    Then you can copy then down as required.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-12-2021
    Location
    Illinois
    MS-Off Ver
    2020
    Posts
    2

    Re: Find the Last Occurrence of a Lookup Value between two columns

    Thank you so much Pete! This looks great! No issues on my end! I really appreciate the help
    Attached Files Attached Files
    Last edited by caves23; 11-12-2021 at 10:20 PM.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: Find the Last Occurrence of a Lookup Value between two columns

    Glad to hear it.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Find Row number of First and Last occurrence matching values in 2 columns
    By muralidaran in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-02-2020, 08:09 AM
  2. Find the Occurrence and Result of each occurrence
    By suriya0702 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2019, 01:43 PM
  3. Replies: 3
    Last Post: 04-25-2017, 04:57 PM
  4. [SOLVED] Find unique occurrence of names across a number of columns
    By DPJW in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-21-2016, 09:28 AM
  5. [SOLVED] Lookup value for occurrence in 5 columns and return value from 6th column in the same row.
    By irishprince in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-06-2015, 09:50 AM
  6. Find each occurrence in a column and do for each occurrence
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2014, 12:29 PM
  7. [SOLVED] Find the last occurrence of a value in multiple columns or a matrix
    By jbh001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2014, 02:07 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