+ Reply to Thread
Results 1 to 3 of 3

Multiple If And Statements

  1. #1
    Registered User
    Join Date
    12-28-2011
    Location
    Here
    MS-Off Ver
    Excel 2007
    Posts
    43

    Multiple If And Statements

    Hi Guys,

    I'm trying to do if and statements to return costs from another sheet based on a drop-down list.

    The list consists of three options - 3x2, 4x3 and other.
    I have other drop-down lists that must also meet a condition to populate the cost.
    For example, if it is TEF and Yes abd 3x2 then populate one cell, if TEF, Yes and 4x3 then populate another value.

    So, I have started coding it, and I have it working for the first statement, but not when I try to add additional criteria.


    =if(and(G25="Yes",G26="3x2",G27="TEF"),Comp!H27)
    This works and populates the proper code. But when I try to add more it gives me the #VALUE! error.

    =if(and(G25="Yes",G26="3x2",G27="TEF"),Comp!H27),if(and(G25="Yes",G26="4x3",G27="TEF"),Comp!H26),if(G25="No","0")
    This is where I'm running into the problem. I think I understand that it is trying to meet all the conditions that are listed, and therefore is causing the problem, but I am not sure how I can write this so that I'm not running into this issue.

    Any help would be greatly appreciated!

  2. #2
    Registered User
    Join Date
    12-28-2011
    Location
    Here
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Multiple If And Statements

    Alright, I just figured out what I was doing wrong.

    The statement should look like this:
    =if(and(G25="Yes",G26="3x2",G27="TEF"),Comp!H27,if(and(G25="Yes",G26="4x3",G27="TEF"),Comp!H26,if( G25="No","0")

    Just eliminating the ) in between the next if statement.

    It always seems like it is something stupid simple. >.<

  3. #3
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    Re: Multiple If And Statements

    Do each of the individual if "segments" work ok for you? Can you then combine just two of them together? Maybe you can just "sneak-up" on the issue?

+ 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