+ Reply to Thread
Results 1 to 3 of 3

Lookup Nth occurrence in a row

  1. #1
    Registered User
    Join Date
    09-03-2017
    Location
    MELBOURNE
    MS-Off Ver
    EXCEL 2011
    Posts
    2

    Lookup Nth occurrence in a row

    Hi all,

    I am trying to create a formula for a few days. It has been very hard for me.

    What I want to do is to find a Nth value in a row. For example, there are invoice dates(always last date of the month) in one row and invoice numbers in another row. I would like to find the 3rd invoice number raised on 28 February.

    I could find a lot of information about Nth occurrence in a column but not much in a row. It would be greatly appreciated if you could help me with this.

    many thanks in advance,
    Pil
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Lookup Nth occurrence in a row

    welcome to the forum, Pil. you have all the same dates in row 4. i am assuming it is not that straightforward. if it is, then 3rd occurrence is simply:
    =D5
    or for you to key nth occurrence (say you key in A6):
    =INDEX(5:5,A6+1)

    but if dates are different, then perhaps this array formula (assuming 28Feb2018 keyed in A7):
    =INDEX(B5:F5,SMALL(IF(B4:F4=A7,COLUMN(B5:F5)),3)-COLUMN(B5)+1)
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    09-03-2017
    Location
    MELBOURNE
    MS-Off Ver
    EXCEL 2011
    Posts
    2

    Re: Lookup Nth occurrence in a row

    Thank you so much, benishiryo!!! Yes it is more complicated than the attached file but when I tried with your formula it worked perfectly. Awesome!!!!
    Last edited by AliGW; 03-06-2018 at 02:10 AM. Reason: Unnecessary quotation removed.

+ 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 Multiple Occurrence of 2 Values (Date & Qty) in a Row
    By Rajeshkumar R in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-01-2017, 02:22 AM
  2. Code to lookup last occurrence
    By Burt_100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2016, 06:02 PM
  3. [SOLVED] Lookup return occurrence value 1st,2nd and 3rd
    By silambarasan.J in forum Excel General
    Replies: 9
    Last Post: 01-20-2016, 12:00 PM
  4. [SOLVED] VLOOKUP Multiple Occurrence for Same Lookup Value
    By Rajeshkumar R in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2014, 02:58 AM
  5. [SOLVED] Lookup nth occurrence
    By Blake 7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-22-2013, 06:04 PM
  6. [SOLVED] Lookup value that is the2nd or 3rd occurrence
    By ssword in forum Excel General
    Replies: 1
    Last Post: 05-25-2012, 11:43 AM
  7. [SOLVED] V Lookup 2nd Occurrence
    By Rodney in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 04-27-2005, 01:06 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