+ Reply to Thread
Results 1 to 7 of 7

[VLOOKUP] Next value if cell contains specific text

  1. #1
    Registered User
    Join Date
    02-09-2022
    Location
    Paris
    MS-Off Ver
    365
    Posts
    17

    [VLOOKUP] Next value if cell contains specific text

    Hello everyone,

    I'm a beginner on Excel so I don't know if my question is an easy one or not.

    Basically i'm using a simple vlookup "=VLOOKUP(F2,B:C,2,FALSE)"

    I would like to know if it's possible to skip the first match C2 if cell D2 contains specific text like "Done" and return value C3 ?

    See my example below :

    3423.jpg


    Thanks for your help
    Last edited by Denox78; 02-09-2022 at 11:48 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,938

    Re: [VLOOKUP] Next value if cell contains specific text

    Welcome to the forum.

    Try this:

    =INDEX(C:C,MATCH(1,(B:B=F2)*(C:C="In Progress"),0))
    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
    Registered User
    Join Date
    02-09-2022
    Location
    Paris
    MS-Off Ver
    365
    Posts
    17

    Re: [VLOOKUP] Next value if cell contains specific text

    I corrected the C:C at the end as D:D and it's working now !

    =INDEX(C:C,MATCH(1,(B:B=F2)*(D:D="In Progress"),0))

    is it possible to add more words than "In Progress" ? If yes what syntax should I use

    Thanks for your help

  4. #4
    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,938

    Re: [VLOOKUP] Next value if cell contains specific text

    Yes, and well spotted!

    Hopefully this sort of thing will work for you:

    =INDEX(C:C,MATCH(1,(B:B=F2)*((D:D="In Progress")+(D:D="Something Else")+(D:D="Another Option")),0))

    Or this way, perhaps:

    =INDEX(C:C,MATCH(1,(B:B=F2)*(D:D<>"In Progress"),0))

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: [VLOOKUP] Next value if cell contains specific text

    An image attachment has limited value. In the future just attach the Excel file. It's easier than taking a screenshot first and then attaching that. Having your file allows us to see and experiment with your data, layout, formulas, code, and possibly attach a file with a completed solution. See yellow banner at the top of the page.

    It's more complicated than just VLOOKUP.

    Here is one solution:

    =INDEX(C:C,MATCH(F2,OFFSET($B$1,MATCH(F2&"Done",B:B&D:D,0),0,99))+MATCH(F2&"Done",B:B&D:D,0))

    This is an array formula. After typing in the formula, do not hit ENTER--hit CTRL+SHIFT+ENTER. You have done it correctly if the formula in the formula box has {braces} around it. You cannot type in the braces; they are just an indicator that it is an array formula.

    Implemented in attached example. By the way, I don't know what you're doing but it is a bad practice to store unencrypted passwords.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: [VLOOKUP] Next value if cell contains specific text

    I took it quite literally when the spec said skip if like "Done". If your requirement is a little different than that then Ali's solution is probably more elegant and easier for you to use.

  7. #7
    Registered User
    Join Date
    02-09-2022
    Location
    Paris
    MS-Off Ver
    365
    Posts
    17

    Re: [VLOOKUP] Next value if cell contains specific text

    Ok well noted, thank you both for your help i'm closing the case

+ 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] Vlookup by specific value (text) within a cell
    By mq1973 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-19-2021, 01:06 PM
  2. [SOLVED] VLOOKUP to return specific text based on content of other cell
    By bundyanimal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-14-2018, 01:18 AM
  3. VLookup to skip blank cell
    By Photanglong in forum Excel General
    Replies: 7
    Last Post: 03-22-2017, 05:56 AM
  4. vlookup - based on finding specific text within a cell
    By gromitnz in forum Excel Formulas & Functions
    Replies: 60
    Last Post: 05-16-2016, 06:14 AM
  5. skip specific cell
    By sanju2323 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-31-2015, 02:01 AM
  6. Find specific text within a cell using IF and VLOOKUP vba
    By dean.rogers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2012, 12:37 PM
  7. VLOOKUP based on cell with specific text
    By hardpenguin in forum Excel General
    Replies: 2
    Last Post: 01-17-2011, 05:33 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