+ Reply to Thread
Results 1 to 7 of 7

Upper Lookup finding nth occurance in a row returning value in corresponding column

  1. #1
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Upper Lookup finding nth occurance in a row returning value in corresponding column

    I am using the following code to lookup the value in A10 occuring in row 2 returning the value in row 1 in the corresponding column. If the row contains multiple occurances of A10 I would like to find the nth occurance i.e. the 1st, 2nd, 3rd, 4th .......

    I know there are ways of using INDEX, SMALL, MATCH and OFFSET but am struggling to get it to work.

    Any ideas?


    [code]
    =OFFSET(B1:Q2,0, MATCH(A10, OFFSET(B1:Q2,ROWS(B1:Q2)-1,0,1,COLUMNS(B1:Q2)),0)-1,1,1)
    [/code
    Last edited by BobTheRocker; 05-11-2014 at 09:22 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,918

    Re: Upper Lookup finding nth occurance in a row returning value in corresponding column

    Can you provide a sample workbook?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Upper Lookup finding nth occurance in a row returning value in corresponding column

    Hi,

    If you could post a workbook with an example or two and your expected results then I'm sure we'll be able to help.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: Upper Lookup finding nth occurance in a row returning value in corresponding column

    Please see attached sample. I would like to find the 1st, 2nd, 3rd etc.....occurrence of "LD" for each person.

    Many Thanks
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Upper Lookup finding nth occurance in a row returning value in corresponding column

    Thanks.

    In R2, array formula**:

    =IF(COLUMNS($A:A)>COUNTA($B2:$Q2),"",SMALL(IF($B2:$Q2=$A$10,$B$1:$Q$1),COLUMNS($A:A)))

    Copy across and down as required.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

  6. #6
    Registered User
    Join Date
    03-13-2010
    Location
    Bedfordshire, England
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: Upper Lookup finding nth occurance in a row returning value in corresponding column

    Thank you very much, that works a treat and is exactly what I was looking for. Will have to dissect now to try and understand the workings for future use.

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Upper Lookup finding nth occurance in a row returning value in corresponding column

    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: 5
    Last Post: 09-12-2012, 01:27 PM
  2. Replies: 1
    Last Post: 01-10-2011, 09:05 AM
  3. Replies: 8
    Last Post: 11-24-2010, 07:24 AM
  4. finding max value and returning text in different column same row
    By Mark6277 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-10-2009, 01:18 PM
  5. [SOLVED] Count the occurance of upper or lower case letters
    By Sivsy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2005, 04:06 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