+ Reply to Thread
Results 1 to 6 of 6

Find Last Entry (Date) in a List satisfying a Condition

  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    29

    Find Last Entry (Date) in a List satisfying a Condition

    My Data comprises a number of rows, and 2 columns. The data grows down the page over time. The First column contains a single Text character and the second column contains a date. The dates are not necessarily in order. I want to search down column 1 to find the row with the LAST "S" (noting there may be several rows with an S in col 1), and return the Date which is in that row in column 2.

    Many thanks in advance.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Find Last Entry (Date) in a List satisfying a Condition

    Hi Rau,

    Try using below formula:-

    {=INDEX($B:$B,MAX(IF(ISNUMBER(SEARCH("s",$A:$A)),ROW($A:$A),"")),0)}

    remember it need to be entered with Ctrl Shift Enter key combination.

    See attached:-Extracting data in front of last S.xlsx

    regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Find Last Entry (Date) in a List satisfying a Condition

    maybe also

    =MAX(INDEX(B:B*(A:A="s"),0),2)

    ***not really tested if all possibility will give correct values, maybe try it. thanks.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  4. #4
    Registered User
    Join Date
    07-22-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Find Last Entry (Date) in a List satisfying a Condition

    THanks (Dilipandey) - almost exactly what I need. Could you show me how to modify the formula to constrain the vertical rows through which it searches. The scenario is that:
    - I want to nominate (in the formula) the first row from which searching begins;
    - I am writing the result into a row in the data table (col B)- so I want to stop searching in the row just above the 'current' row (where the formula resides).

    Hope that's expressed clearly?

    ALSO - note that in column A, each entry is only a SINGLE character, eg. "S", or "T" or etc.
    Last edited by rau; 09-04-2012 at 07:29 PM. Reason: fix typo

  5. #5
    Registered User
    Join Date
    07-22-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    29

    Re: Find Last Entry (Date) in a List satisfying a Condition

    OK, maybe I've got it:

    {=INDEX(B1:B10,MAX(IF(ISNUMBER(SEARCH("s",A1:A10)),ROW(A1:A10),"")),0)}

    This formula is in cell B11. Thanks for your help.

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Find Last Entry (Date) in a List satisfying a Condition

    Cheers

    Please mark this thread as [solved].. thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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