+ Reply to Thread
Results 1 to 4 of 4

Nested IF/AND with VLOOKUP

  1. #1
    Registered User
    Join Date
    11-22-2017
    Location
    Nowhere, VA
    MS-Off Ver
    2013
    Posts
    3

    Nested IF/AND with VLOOKUP

    Hello Everyone.

    I am having trouble with a Nested IF/AND statement with VLOOKUP. Here is the function <=IF(AND(Sheet5!G4="Access CDS",Sheet2!$B39,Sheet2!$E39),VLOOKUP(Sheet2!$A39,Sheet2!$A39,1),IF(AND(Sheet5!G4="Transfer CDS",Sheet2!$C39,Sheet2!$E39),VLOOKUP(Sheet2!$A39,Sheet2!$A39,1),IF(AND(Sheet5!G4="Multilevel CDS",Sheet2!$D39,Sheet2!$E39),VLOOKUP(Sheet2!$A39,Sheet2!$A39,1),"")))>

    So Sheet5!G4 is a drop down box. What I am trying to do is if Sheet5!G4 shows Access CDS and Sheet2!B39 and Sheet2!E39 evaluate to True, show Sheet2!A39, Else IF Sheet5!G4 shows Transfer CDS and Sheet2!$C39 and Sheet2!$E39 evaluate to True, show Sheet2!A39....and so on. Sheet5!G4 is a drop down list.

    I'm new to Excel but do have some programming knowledge although it has been quite a while...

    Thanks in advance for your help.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,180

    Re: Nested IF/AND with VLOOKUP

    VLOOKUP(Sheet2!$A39,Sheet2!$A39,1)

    This doesn't make sense as your looking up the same value you are returning: in fact, you are returning the same value, the only variable being B39,C39,D39

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    11-22-2017
    Location
    Nowhere, VA
    MS-Off Ver
    2013
    Posts
    3

    Re: Nested IF/AND with VLOOKUP

    I'll have to create a new workbook to post. In reading your comment, maybe VLOOKUP isn't what I want to be using?

    Sheet 2 has 5 columns. Column A represents letter/number combinations such as A1-A532. Columns B, C, and D are populated with TRUE or FALSE. Columns BCD are TRUE if they meet the requirement to have a Column A
    value assigned to it (this was done manually, not by a function), and FALSE if they don't meet the requirement.

    Column E is another TRUE/FALSE column based on a Yes/No scenario.

    What I am wanting to do is this by having a drop down menu on a different sheet:

    IF Column E is True AND Column B OR Column C OR Column D is True

    Print the information in the corresponding row from Column A

    Each row is a unique letter/number combo. Each Column is the exact same length which corresponds to Column A.

    Column E MUST be TRUE and either Column from B, C or D MUST be TRUE to return the info in Column A. I just want to be able to use a drop down to choose which Column (B,C or D) that I want to validate against.

    I'll try to come up with a quick workbook...but hopefully this somewhat explains it.

    Should mention that I will only be validating Column E against either B, C or D based on the selection made from the drop down box if that wasn't clear.

    Thanks for help!
    Last edited by Shanebass; 11-22-2017 at 02:27 PM.

  4. #4
    Registered User
    Join Date
    11-22-2017
    Location
    Nowhere, VA
    MS-Off Ver
    2013
    Posts
    3

    Re: Nested IF/AND with VLOOKUP

    I figured it out. In the final product Sheets 1 and 3 will be hidden. What I was going for is picking a control set based on the variables in sheet 1 Column(s)B, C or D being TRUE and Column E being TRUE. Sheet 2 is where users will choose the variable. Sheet 3 is where the logic resides. Column A determines which variable is TRUE and if Column E is TRUE. If column E is not TRUE, the default is "Not Selected" regardless of the variable chosen. Column B is the logic behind which variable was chosen. This is the part I was getting hung up on previously. I just made the choice either TRUE or FALSE and then wrote and IF/AND statement based on the choice.

    It works. Might not be the prettiest but it accomplishes what I want. I wouldn't mind having a few different independent reviews to make sure to make sure I am right though.

    Thanks!
    Attached Files Attached Files

+ 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] Nested vlookup or nested IFAND function?
    By jeptik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2017, 02:27 AM
  2. [SOLVED] Nested Vlookup, or Vlookup that looks at two columns, not just one?
    By FirestarZA in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2014, 08:18 AM
  3. Nested VLOOKUP (I think)
    By rich.allan in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-12-2013, 09:31 PM
  4. [SOLVED] Nested IF or Vlookup?
    By zhills63 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-24-2013, 11:04 AM
  5. VLookup & Nested IF Help
    By pmd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2010, 12:09 PM
  6. Vlookup across sheets, nested Vlookup possibly?
    By paid2mkgrlspanic in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-09-2009, 05:10 PM
  7. [SOLVED] Nested IF with a VLOOKUP?
    By plunk25 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2006, 01:10 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