+ Reply to Thread
Results 1 to 3 of 3

IF logical test pass return with 1st LOOKUP if true, if false then return with 2nd VLOOKUP

  1. #1
    Registered User
    Join Date
    09-05-2017
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    22

    IF logical test pass return with 1st LOOKUP if true, if false then return with 2nd VLOOKUP

    Hi folks.

    I made as much effort as possible to find an answer to my query, however I failed so I need your help.

    I have a spreadsheet with few tabs. The end TAB "Schedule" have to pull the dates from few different places, depend on the status of MRP element.

    I've managed to get this to work to 75% but I failed on last bit

    So here is the status of the formula:

    Run 1st - If status = "Order" - pull the date from ZS80, Colum I - SUCCESS
    Run 2nd - If status = "Release order for a stock transfer order" - pull the date from ZP11, Column G - SUCCESS
    Run 3rd - If status = "Release order for a stock transfer order" but can't find the record in ZP11 then look at the date on ZPEM, COLUMN C - FAIL
    Run 4th - If status = " --- anything in the field --- " - - pull the date from ZPEM, Column C - SUCCESS

    Here is the formula:

    =IFERROR(IF(F2="Order",VLOOKUP(Schedule!G2,'ZS80'!$A$2:'ZS80'!$I$10000,9,0),IF(F2="Release order for a stock transfer order",VLOOKUP(Schedule!G2,'ZP11'!$B$2:'ZP11'!$G$10000,6,0),IF(F2="Release order for a stock transfer order",VLOOKUP(Schedule!G2,IF({1,0,0,0,0},ZPEM!$G$2:ZPEM!$G$10000,ZPEM!$C$2:ZPEM!$C$10000),5,0),IF(NOT(ISBLANK(F2)),VLOOKUP(Schedule!G2,IF({1,0,0,0,0},ZPEM!$G$2:ZPEM!$G$10000,ZPEM!$C$2:ZPEM!$C$10000),5,0))))),"")


    Please help with bit in red because I suppose here is the problem.

    - Formula to entered into TAB Schedule, Column P.

    Thank you and best regards.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: IF logical test pass return with 1st LOOKUP if true, if false then return with 2nd VLO

    =IFERROR(IF(F2="Order",VLOOKUP(Schedule!G2,'ZS80'!$A$2:'ZS80'!$I$10000,9,0),IFERROR(IF(F2="Release order for a stock transfer order",VLOOKUP(Schedule!G2,'ZP11'!$B$2:'ZP11'!$G$10000,6,0),IF(NOT(ISBLANK(F2)),VLOOKUP(Schedule!G2,IF({1,0,0,0,0},ZPEM!$G$2:ZPEM!$G$10000,ZPEM!$C$2:ZPEM!$C$10000),5,0))), IF(F2="Release order for a stock transfer order",VLOOKUP(Schedule!G2,IF({1,0,0,0,0},ZPEM!$G$2:ZPEM!$G$10000,ZPEM!$C$2:ZPEM!$C$10000),5,0),""))),"")

    Here's the correct formula. It should work.

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: IF logical test pass return with 1st LOOKUP if true, if false then return with 2nd VLO

    Here's another version of same formula. It works.

    =IFERROR(IF(F2="Order",VLOOKUP(Schedule!G2,'ZS80'!$A$2:'ZS80'!$I$10000,9,0),IF(F2="Release order for a stock transfer order",IFERROR(VLOOKUP(Schedule!G2,'ZP11'!$B$2:'ZP11'!$G$10000,6,0),VLOOKUP(Schedule!G2,IF({1,0,0,0,0},ZPEM!$G$2:ZPEM!$G$10000,ZPEM!$C$2:ZPEM!$C$10000),5,0)),IF(NOT(ISBLANK(F2)),VLOOKUP(Schedule!G2,IF({1,0,0,0,0},ZPEM!$G$2:ZPEM!$G$10000,ZPEM!$C$2:ZPEM!$C$10000),5,0)))),"")

+ 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. Replies: 2
    Last Post: 02-06-2013, 12:16 PM
  2. Logical test in IF function returning TRUE when it should be FALSE
    By lvjeff in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-28-2012, 05:13 PM
  3. =IF(logical test,value if true,value if false) always backwards!
    By chaminod in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2005, 02:10 PM
  4. [SOLVED] Can LooKUP get return value of True or False?
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2005, 07:30 PM
  5. [SOLVED] if logical test true, then hlookup, if false then difference betwe
    By VictoriaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. if logical test true, then hlookup, if false then difference betwe
    By VictoriaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] if logical test true, then hlookup, if false then difference betwe
    By VictoriaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. if logical test true, then hlookup, if false then difference betwe
    By VictoriaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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