+ Reply to Thread
Results 1 to 8 of 8

IF and Vlookup formula

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 365
    Posts
    30

    IF and Vlookup formula

    Would 2 vlookups work on an IF function?

    I have =IF(G2<>H2,VLOOKUP(O2,Sheet2!E:F,2,FALSE),VLOOKUP(O2,Sheet2!A:B,2,FALSE))

    but the false return gives me #NA

    I have G2 and H2 as not equal which gives me the answer and if G2=H2 should give the result on the table array

    any thoughts?

  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,202

    Re: IF and Vlookup formula

    Not without a workbook! Please see yellow banner at top of the page on how to attach a workbook.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    01-21-2013
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 365
    Posts
    30

    Re: IF and Vlookup formula

    attaching file here for reference
    Attached Files Attached Files

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

    Re: IF and Vlookup formula

    Guessing

    VLOOKUP should be reversed

    =IF(G2<>H2,VLOOKUP(O2,Sheet2!A:B,2,FALSE),VLOOKUP(O2,Sheet2!E:F,2,FALSE))

    or

    =IF(G2=H2,VLOOKUP(O2,Sheet2!E:F,2,FALSE),VLOOKUP(O2,Sheet2!A:B,2,FALSE))

  5. #5
    Registered User
    Join Date
    01-21-2013
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 365
    Posts
    30

    Re: IF and Vlookup formula

    Quote Originally Posted by JohnTopley View Post
    Guessing

    VLOOKUP should be reversed

    =IF(G2<>H2,VLOOKUP(O2,Sheet2!A:B,2,FALSE),VLOOKUP(O2,Sheet2!E:F,2,FALSE))

    or

    =IF(G2=H2,VLOOKUP(O2,Sheet2!E:F,2,FALSE),VLOOKUP(O2,Sheet2!A:B,2,FALSE))
    Yea, I tried that also, it doesn't follow my intended outcome which is weird cause afaik it should work, right?

  6. #6
    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,202

    Re: IF and Vlookup formula

    'No Show - day 1" is in column E and your formula is looking at column A when G2=H2: hence my response.

  7. #7
    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,202

    Re: IF and Vlookup formula

    There are many selections in O2 which will return #N/A so perhaps you need to tailor the O2 drop down to only have valid conditions if G2:H2.

  8. #8
    Registered User
    Join Date
    01-21-2013
    Location
    Philippines
    MS-Off Ver
    Microsoft Excel 365
    Posts
    30

    Re: IF and Vlookup formula

    Quote Originally Posted by JohnTopley View Post
    'No Show - day 1" is in column E and your formula is looking at column A when G2=H2: hence my response.
    OMG lol I totally missed that! Just needed the full list of the array

+ 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