+ Reply to Thread
Results 1 to 12 of 12

chaining if formula and vlookup

  1. #1
    Registered User
    Join Date
    05-04-2015
    Location
    Irvine, CA
    MS-Off Ver
    2010
    Posts
    37

    chaining if formula and vlookup

    I been staring at this IF Chain formula for days trying to figure out. I think there may be an easier way, but here is the logic of it if anyone could please help. the formula will belong in cell X2

    if W2 > v2 , then return text "push out"
    if W2 < V2, then return text "pull in"
    if W2 = V2, then return text "no change"
    if W2 = "SEE STATUS", then vlookup(a2,table,27,false) (this will return a date value)
    **this last part is where I am stumped**
    if W2 = "SEE STATUS", and the vlookup(a2,table,27,false) returns N/A or error, then return text "Cancelled"

    this is the formula I currently have and doesn't seem to be working. gives me a "VALUE" on the ones that are "SEE STATUS":
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: chaining if formula and vlookup

    Maybe like this (ontested).

    =IF((W3-V3)<0,"PULLED IN",IF((W3-V3)>0,"PUSHED OUT",IF(W3=V3,"NO CHANGE",iferror(IF(ISTEXT(W3),VLOOKUP(A3,'OTD-main'!$B:$AA,27,FALSE),"Cancelled")))))
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    05-04-2015
    Location
    Irvine, CA
    MS-Off Ver
    2010
    Posts
    37

    Re: chaining if formula and vlookup

    it says I've entered too few arguments.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,661

    Re: chaining if formula and vlookup

    Put the text-testing first, then value-testing:

    =IF(ISTEXT(W3),IFERROR(VLOOKUP(A3,'OTD-main'!$B:$AA,27,0),"cancel"),IF(W3=V3,"NO CHANGE",IF(W3<V3,"PULLED IN","PUSHED OUT")))
    Quang PT

  5. #5
    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
    30,979

    Re: chaining if formula and vlookup

    Try ...


    =IF((W3-V3)<0,"PULLED IN",IF((W3-V3)>0,"PUSHED OUT",IF(W3=V3,"NO CHANGE",IFERROR(IF(ISTEXT(W3),VLOOKUP(A3,'OTD-main'!$B:$AA,27,FALSE),"Cancelled"),""))))

  6. #6
    Registered User
    Join Date
    05-04-2015
    Location
    Irvine, CA
    MS-Off Ver
    2010
    Posts
    37

    Re: chaining if formula and vlookup

    Bebo, yours worked amazing. thanks everyone for your input!

  7. #7
    Registered User
    Join Date
    05-04-2015
    Location
    Irvine, CA
    MS-Off Ver
    2010
    Posts
    37

    Re: chaining if formula and vlookup

    hold on, I spoke too soon. Bebo, yours seemed to give me "Cancelled" even if the vlookup value existed in the OTD table.

  8. #8
    Registered User
    Join Date
    05-04-2015
    Location
    Irvine, CA
    MS-Off Ver
    2010
    Posts
    37

    Re: chaining if formula and vlookup

    After further investigating, it seems the vlookup function is giving me a "REF!" error.

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,661

    Re: chaining if formula and vlookup

    Quote Originally Posted by clammastak View Post
    After further investigating, it seems the vlookup function is giving me a "REF!" error.
    I though same. Check your lookup_value(A3) in OTD sheet to make sure they are same format.

    i.e A3 is number stored as text : using VLOOKUP(A3+0,...)

  10. #10
    Registered User
    Join Date
    05-04-2015
    Location
    Irvine, CA
    MS-Off Ver
    2010
    Posts
    37

    Re: chaining if formula and vlookup

    Bebo, your formula worked great! I resolved the issue...and it was that "27" was not the right count from $B:$AA. Its actually only 26 ...D'oh. so it was referencing a column not within the range of the table.

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,661

    Re: chaining if formula and vlookup

    Check the lookup table: it has only 26 columns while you are looking 27th column!

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,661

    Re: chaining if formula and vlookup

    Yah. nice tohear it works. Good luck!

+ 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 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
  2. Chaining IF Fonction
    By Born2Fly in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-06-2013, 04:58 PM
  3. [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
  4. Vlookup referencing a vlookup formula
    By laurenann in forum Excel General
    Replies: 1
    Last Post: 01-24-2011, 05:52 PM
  5. Chaining multiple calculations in formula
    By RobT in forum Excel General
    Replies: 2
    Last Post: 04-24-2010, 05:42 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