+ Reply to Thread
Results 1 to 2 of 2

Find the second to the last occurence of a value in a column with multiple criteria

  1. #1
    Registered User
    Join Date
    09-06-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    1

    Find the second to the last occurence of a value in a column with multiple criteria

    Hi! I need your help. I am trying to create a formula in finding the second to the last occurrence of a value in a column with multiple criteria. I attached the file for the sample table. There should be 5 columns. A is for Date, B is for UserNumber and C for CurrentLevel. In column D I need to get the previous level of the specified username. I used this formula:

    =INDEX(C$2:C4,SUMPRODUCT(MAX((B$2:B4=B5)*ROW(B$2:B4)))-ROW(C$2:C4)+1)

    And in column E I need to get the previous level of the specified username from the previous month. This is the formula that I am trying to use but looks so wrong!

    =INDEX(C$2:C4,SUMPRODUCT(A2:A4=MONTH(A5-1)*MAX((B$2:B4=B5)*ROW(B$2:B4)))-ROW(C$2:C4)+1)

    Please help!

    Thanks a lot!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Find the second to the last occurence of a value in a column with multiple criteria

    I couldn't get it to work with SUMPRODUCT so I used an array formula (enter with Ctrl + Shift + Enter).
    I also simplified your old formula a bit.


    For some reason MONTH would not work inside the SUMPRODUCT, weird. Maybe someone else has some knowledge of this?
    Attached Files Attached Files
    Last edited by Jacc; 09-07-2013 at 12:32 PM.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

+ 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. vlookup with multiple occurence in column
    By Trickle in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-11-2013, 04:12 PM
  2. Replies: 4
    Last Post: 05-03-2013, 12:09 PM
  3. Replies: 2
    Last Post: 01-20-2012, 12:55 PM
  4. Find nth occurence in a table with multiple criteria
    By efernandes67 in forum Excel General
    Replies: 2
    Last Post: 02-01-2011, 05:36 PM
  5. [SOLVED] Find first occurence of specific data in a column.
    By Ben in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2005, 11:06 AM

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