+ Reply to Thread
Results 1 to 11 of 11

Index match nth occurrence or just get nth match

  1. #1
    Registered User
    Join Date
    08-12-2014
    Location
    CA
    MS-Off Ver
    2011
    Posts
    73

    Index match nth occurrence or just get nth match

    Hello all,
    My database project is nearly done thanks to a ton of help from this forum. Only a few issues remain. I am wondering how I can use a formula to index match the nth occurrence. Or just return the nth occurrence anyway. I have attached a file where I am using index match and getting the first occurrence.

    Thanks,
    sdl2Index_Match.xlsb

  2. #2
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Index match nth occurrence or just get nth match

    I'm not sure that you can find a specific number of an instance with a formula but you could use a macro. Now as of right now the macro looks for a sheet named "Sheet1" to find the L1 and P2 values and only looks nth occurrence in column A on the active sheet. So as of right now the macro is limited to those specific but they can be changed to meet your ranges of cells. Change the macro around to met your specifics or if you want me to do it upload your full sheet with all the data and ranges on it and I will modify the macro. Let me know whether it works for what you desired either way. Thanks.


    Please Login or Register  to view this content.
    If you haven't used a macro before just let me know and I can walk you through it or upload your full sheet tell me what button / hotkey you want it setup on and I will do that for you.

    Just in case you haven't used a macro before press and hold ALT + F11 to open VBA editor, Insert module, past
    Thank those who have helped you by clicking the Star * below their name and please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Registered User
    Join Date
    08-12-2014
    Location
    CA
    MS-Off Ver
    2011
    Posts
    73

    Re: Index match nth occurrence or just get nth match

    Hi jessebranum777,
    Thank you for your response. I am familiar with VBA, I was really trying to avoid it to be honest. I have this formula looking up different columns about 20 different ways. VBA seemed hard to use for this... I tried it out and its coming back nth not found with a message box that can not be closed
    Last edited by sdl2; 11-10-2014 at 04:57 PM.

  4. #4
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Index match nth occurrence or just get nth match

    I will do some more research then because I love finding ways around things. I'll be back.

  5. #5
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Index match nth occurrence or just get nth match


  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Index match nth occurrence or just get nth match

    Maybe this is what you are looking for:
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

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

    Re: Index match nth occurrence or just get nth match

    maybe
    =INDEX(Sheet2!R1:R20,MATCH(LARGE(INDEX((Sheet2!A1:A20=P2)*(1/ROW(A1:A20)),0),L1),INDEX((Sheet2!A1:A20=P2)*(1/ROW(A1:A20)),0),0))
    "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

  8. #8
    Forum Contributor Jack7774's Avatar
    Join Date
    08-31-2012
    Location
    Georgia, US
    MS-Off Ver
    Excel 2010
    Posts
    576

    Re: Index match nth occurrence or just get nth match

    Quote Originally Posted by newdoverman View Post
    Maybe this is what you are looking for:
    Now that is a creative idea. Points for you for creativity and helping me keep something on deposit for ideas for the future. Nice.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Index match nth occurrence or just get nth match

    Thank you for the feedback.

  10. #10
    Registered User
    Join Date
    07-14-2013
    Location
    Pakistan
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Index match nth occurrence or just get nth match

    Hi Guru,

    I was wondering if you could also help me with the same formula?
    I've similar situation but return value (answer) is descriptive (TEXT).
    I've enclosed sample workbook if you could look into the same and assist thanks!


    P.S. sorry forgot to attach
    Attached Files Attached Files
    Last edited by MYEM1983; 05-21-2018 at 03:57 AM.

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Index match nth occurrence or just get nth match

    Please start a new thread of your own.
    Last edited by newdoverman; 05-21-2018 at 08:28 PM.

+ 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. Using index and match to return a value based on earliest occurrence (MONTH)
    By potatoman in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-09-2014, 06:12 AM
  2. Using index and match to return a value based on earliest occurrence (MONTH)
    By potatoman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2014, 06:16 AM
  3. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  4. [SOLVED] Index Match row value and nth occurrence of header
    By dm@stams in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-22-2013, 05:43 PM
  5. Replies: 5
    Last Post: 02-29-2012, 08:51 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