+ Reply to Thread
Results 1 to 14 of 14

Formula to check LAST CELL in column containing one of the names in a list

  1. #1
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Formula to check LAST CELL in column containing one of the names in a list

    Hello,
    i made a list in sheet 2 names "workers"
    in sheet 1,
    i want to find last cell in column b that contains one of the names in the list "workers" and also having a value in column c and d, and finally return the corresponding date in column a.
    Here is an attached sample for better understanding. Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to check LAST CELL in column containing one of the names in a list

    With an pivot table.

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

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

    Re: Formula to check LAST CELL in column containing one of the names in a list

    hi childzzz. try this non-array formula as an alternative:
    Please Login or Register  to view this content.

    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

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Formula to check LAST CELL in column containing one of the names in a list

    =lookup(2,1/(isnumber(match(b2:b7,workers,0)))/(c2:c7<>"")/(d2:d7<>""),a2:a7)
    Last edited by Teethless mama; 01-05-2013 at 11:55 AM.

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Formula to check LAST CELL in column containing one of the names in a list

    Using your posted workbook...
    This regular formula returns the Col_A date associated with the last Col_B value that matches a Workers list item AND has values in Col_C and Col_D
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to check LAST CELL in column containing one of the names in a list

    If I understand what you want to do...

    This formula entered in B1 and copied down:

    =IFERROR(LOOKUP(2,1/((Sheet2!B$2:B$7=A1)*(Sheet2!C$2:C$7<>"")*(Sheet2!D$2:D$7<>"")),Sheet2!A$2:A$7),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Formula to check LAST CELL in column containing one of the names in a list

    Thanks oeldere, but I don't like working with pivot tables.
    @ benishiryo, thanks man it works.
    One more question, if I make a second list named "WORKERS2", and create a dropdown list in cell B14, how can I adjust the formula to automatically change based on my selection in cell B14? can I just replace WORKERS in the formula with B14? I will attach another sample. Thank you all for your quick replies
    Attached Files Attached Files

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Formula to check LAST CELL in column containing one of the names in a list

    Try with INDIRECT (with thank benishiryo);
    =LOOKUP(2,1/(ISNUMBER(MATCH(B2:B7,INDIRECT(B14),0)))/(C2:C7<>"")/(D2:D7<>""),A2:A7)
    Quang PT

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to check LAST CELL in column containing one of the names in a list

    Please Login or Register  to view this content.
    I noticed your reaction, but once you've seen the possibilities of pivot table, you "only" will work with pivot table.

    So i try again with an solution with pivot table. (see the attached file).
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Formula to check LAST CELL in column containing one of the names in a list

    THANKS ALL for your help. Much appreciated

  11. #11
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Formula to check LAST CELL in column containing one of the names in a list

    Non-Volatile Solution:

    =LOOKUP(2,1/(ISNUMBER(MATCH(B2:B7,CHOOSE(MATCH(B14,{"WORKERS","WORKERS2"},0),WORKERS,WORKERS2),0)))/(C2:C7<>"")/(D2:D7<>""),A2:A7)

    this one a little bit shorter

    =LOOKUP(2,1/(ISNUMBER(MATCH(B2:B7,IF(B14="WORKERS",WORKERS,WORKERS2),0)))/(C2:C7<>"")/(D2:D7<>""),A2:A7)

  12. #12
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Formula to check LAST CELL in column containing one of the names in a list

    That's a good solution, thanks @ Teethless mama,
    but what if the list grows to be 3 or more (WORKERS,WORKERS1,WORKERS2...)??

  13. #13
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Formula to check LAST CELL in column containing one of the names in a list

    Quote Originally Posted by chiidzzz View Post
    but what if the list grows to be 3 or more (WORKERS,WORKERS1,WORKERS2...)??
    Have you checked with INDIRECT in #8? I think it works.

  14. #14
    Forum Contributor
    Join Date
    07-08-2012
    Location
    beirut
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Formula to check LAST CELL in column containing one of the names in a list

    YES IT WORKS
    Thankssss alot

+ 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