+ Reply to Thread
Results 1 to 5 of 5

Multiple If Then Vlookups.

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Multiple If Then Vlookups.

    I want to combine the following into one statement,

    =IF(ISNA(VLOOKUP($A2,'WTD'!$A$2:$F$5,5,FALSE)),H2,ROUND(H2*0.25,2))

    And

    =IF(ISNA(VLOOKUP($A2,'WTR'!$A$2:$F$10,5,FALSE)),H2,ROUND(H2*0.1,2))


    Basically, do both of those functions, since there drawing from 2 different sheets.

    How to combine?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    you cannot.

    you are stating that if something is false, do 1 thing or return another.

    Then you test if something else is false do the same one thing but if not return yet another value


    =if(a=3,99,88)
    =if(a=5,99,77)

    can you see why these 2 cannot be combined?

  3. #3
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    At present you have only asked why something does not work.

    If you specify what you want to achieve, someone may come up with a solution.

    As Robert says, you currently have two possible outcomes for the same condition.

    Ideally, post a copy of your sheet with the explanatrion of the desired outcome.

    Ed

  4. #4
    Forum Contributor Portuga's Avatar
    Join Date
    02-20-2004
    Location
    Portugal
    MS-Off Ver
    365
    Posts
    852
    If you are looking to see the 2 values in the same cell you can concatenate both functions: (In the case bellow seperated by a "/" symbol.

    =IF(ISNA(VLOOKUP($A2,'WTD'!$A$2:$F$5,5,FALSE)),H2, ROUND(H2*0.25,2)) & " / " & IF(ISNA(VLOOKUP($A2,'WTR'!$A$2:$F$10,5,FALSE)),H2 ,ROUND(H2*0.1,2))
    If you found the solution to your question. Mark the thread as "Solved"
    Thank everyone that helped you with a valid solution by clicking on their

    There is no such thing as a problem, only a temporary lack of a solution

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    How about

    =IF(AND(ISNA(VLOOKUP($A2,wtd!$A$2:$F$5,5,FALSE)),ISNA(VLOOKUP($A2,wtr!$A$2:$F$10,5,FALSE))),H2,IF(AND(NOT(ISNA(VLOOKUP($A2,wtd!$A$2:$F$5,5,FALSE))),ISNA(VLOOKUP($A2,wtr!$A$2:$F$10,5,FALSE))),ROUND(H2*0.25,2),ROUND(H2*0.1,2)))
    You don't give any precedence to determine which output you want if both vlookup formulas would return a valid result. If this one isn't correct, then swap the 2 round formulas to return the opposite result.

    If you want something else entirely when both would return a valid result, then you will have to nominate.


    HTH

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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