+ Reply to Thread
Results 1 to 16 of 16

VLOOKUP avoiding rows with specific criteria

  1. #1
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    VLOOKUP avoiding rows with specific criteria

    i have attached two worksheets. Worksheet 1 has the formulas and worksheet 2 is the lookup array.
    the formulas are in cells C9,D9 and E9. Normally you would use a IF() function to the check for values
    in each row of column B before the formula would activate. Here I'm using a single cell C9, D9 and E9.
    The formula automatically moves down the D column and if there is a value in the D column it will go
    to WS 2 and find the value. I need the formula to also look at the B column and if it finds a value "BYE'
    leave cells C9, D9 and E9 blank. Cell C9 shows where I have tried to add the IF() function and cells
    D9 and E9 shoes the formula without the IF() function

    *NOTE* THIS PART OF THE FORMULA WORKS =VLOOKUP(LOOKUP(2,1/($D$2:$D$6<>""),$C2:$C6),Sheet2!$B$3:$F$7,4,FALSE)
    AND IF YOU WORK WITH THE EXAMPLE BY PLACING VALUES IN COLUMN "D" YOU WILL SEE HOW THE FORMULA MOVES DOWN THE
    COLUMN AND PICKS UP THE NEXT ROW.

    THE SPECIFIC CRITERIA I NEED IS TO ADD SOMETHING IN THE FORMULA SUCH AN IF() FUNCTION THAT WILL
    BYPASS THE ROW IF "BYE" IS IN COLUMN "B". *NOTE*

    THE REASON FOR THAT IS THE SPREADSHEET HAS SEVERAL OTHER COLUMNS THAT WILL ACTIVATE AND FILL IN WHICH
    I DON'T WANT.
    Last edited by bowslam; 11-13-2020 at 12:28 PM. Reason: Instructed to change by Mod

  2. #2
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    Re: Help with VLOOKUP formula

    The Go Advanced was not shown to provide worksheets so here it is now.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    Re: Help with VLOOKUP formula

    Follow up info. If you place a value in cell D3 you will see the info in cell D9 change. Currently we are
    looking up info on team one. Once there is a value placed in D3 it will lookup info for team 2. I hope
    that helps.

  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
    81,247

    Re: Help with VLOOKUP formula

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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.

  5. #5
    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
    81,247

    Re: VLOOKUP avoiding rows with specific criteria

    Thank you - your title is now fine. I have moved this thread to a more appropriate sub-forum. You now need to be patient and wait for help to be offered.

    Whilst you are waiting ...

    Administrative Note:

    Welcome to the forum.

    Although we value your privacy as much you do, it could be important that members have a rough idea of your location as the solutions they offer may be affected by your locale. For instance, you might in the future post questions which are related to your regional settings.

    With this in mind, please update your profile to something more precise (something such as UK, Europe, USA, UAE, etc. will suffice).

    Thank you for helping us to help you.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: VLOOKUP avoiding rows with specific criteria

    I really don't follow the logic of this, but, just maybe....


    =IFERROR(VLOOKUP(LOOKUP(2,1/(($D$2:$D$6<>"")*($B$2:$B$6<>"Bye")),$C$2:$C$6),Sheet2!$B:$F,COLUMNS($A:C),FALSE),"")

    copied across
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    Re: VLOOKUP avoiding rows with specific criteria

    Thanks Glenn for you reply and time looking at my problem.

    I'll test this in my spreadsheet. I think it is finding the "BYE" in column A but it looks like instead
    of leaving the cell blank as I want it is leaving the info from the prior row.

    Thanks again for your time and expertise.

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,620

    Re: VLOOKUP avoiding rows with specific criteria

    I need the formula to also look at the B column and if it finds a value "BYE'
    leave cells C9, D9 and E9 blank
    Please Login or Register  to view this content.
    Last edited by protonLeah; 11-13-2020 at 07:41 PM.
    Ben Van Johnson

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: VLOOKUP avoiding rows with specific criteria

    1. Look at the formula:

    =IFERROR(VLOOKUP(LOOKUP(2,1/(($D$2:$D$6<>"")*($B$2:$B$6<>"Bye")),$C$2:$C$6),Sheet2!$B:$F,COLUMNS($A:C),FALSE),"")

    It is looking for the non-presence of bye in column B.



    2. If ProtonLeah hasn't got it right, repost your sheet, showing some manually calculated answers for the senarios you need to cover.

  10. #10
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    Re: VLOOKUP avoiding rows with specific criteria

    Morning Glenn,

    Your formula works great. Thanks again for your help.

    I do have some question I hoped that you you answer for me.

    I have seen the front part of your formula before but did think it would work for me
    =IFERROR(VLOOKUP(LOOKUP(2,1/(($D$2:$D$6<>"")*($B$2:$B$6<>"Bye")),$C$2:$C$6
    Because of the multiply sign here "")*($B$6.

    I see that it just multiplies 1 into 1 or into 0's. Interesting!

    The next part I find very interesting as to how it works and may save me a great amount
    of work in the future. Sheet2!$B:$F,COLUMNS($A:C),FALSE),"") I tried to highlight this in red
    but wasn't sure it would work as yours did above. This is where I use VLOOKUP table array and column
    index number. I have to put the formula in 192 cels and in each cell I have to a different column index number.

    The way you have done it would be much easier and faster but I"m not sure I understand it. I have copied
    your formula into several different cells and it seems to work no matter where I put it. But it does search the
    correct location and supplies the correct answer.

    I would like to attach my worksheet array table (which is larger than the example) to get guidance on
    using the columns formula if it's okay with you.

    Thanks again for your help.

  11. #11
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    Re: VLOOKUP avoiding rows with specific criteria

    ProtonLeah,

    Thank you for your response and suggestion. I haven't had time to look at it as
    I was working with Glenn's formula with is working.

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: VLOOKUP avoiding rows with specific criteria

    Feel free. If its too big (>1 Mb) zip it or save as .xlsb. It's Sat nite here and I'm away off to be irresponsible (socially distanced) for a while. Back tomorrow.

  13. #13
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    Re: VLOOKUP avoiding rows with specific criteria

    Morning Glenn,

    I hope you have a great evening.

    I'm attaching a new example from my worksheet. I have used your formula with my
    old vlookup that searches by index_num Row 23 Col D-I. Below those cells I have used your complete
    formula using the column function Row 24 Col D-I. The column function really makes it much easier
    and faster when you need to copy several cells to the right. Great job and thanks
    for your help. I now understand how the column function works.
    Attached Files Attached Files

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,791

    Re: VLOOKUP avoiding rows with specific criteria

    NOTE, there is both a COLUMN function (which returns the column number of a cell) and a COLUMNS function (which returns the number of columns between two cells.

    Pete

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: VLOOKUP avoiding rows with specific criteria

    All sorted then??

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  16. #16
    Registered User
    Join Date
    11-03-2011
    Location
    USA
    MS-Off Ver
    Excel 365
    Posts
    18

    Re: VLOOKUP avoiding rows with specific criteria

    Pete_UH,

    Thanks for our input. More for me to learn.

+ 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 formula or VLOOKUP worksheet.function
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-09-2017, 09:40 AM
  2. Replies: 5
    Last Post: 12-07-2016, 09:18 AM
  3. VBA external VLOOKUP instead of VLOOKUP-formula in cell
    By ExcelBonk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2016, 02:41 PM
  4. [SOLVED] Vlookup with column name instead of col_index_name(3rd Section of Vlookup formula)
    By akulka58 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-21-2014, 10:42 AM
  5. [SOLVED] VBA code for change vlookup formula to vlookup formula with ISNA
    By erprasannaa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2013, 03:33 AM
  6. Vlookup referencing a vlookup formula
    By laurenann in forum Excel General
    Replies: 1
    Last Post: 01-24-2011, 05:52 PM
  7. vlookup-reate a vlookup formula?
    By Pam C in forum Excel General
    Replies: 1
    Last Post: 03-16-2006, 12:15 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