+ Reply to Thread
Results 1 to 4 of 4

If And Or Statement for 3 parameters

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    15

    If And Or Statement for 3 parameters

    Hi,

    I am trying to write,

    If g8=y, h8=y then 2.5%, if g8=n, h8=y then 5.0%, if g8=n, h8=n then 0

    Solved!
    Last edited by jchohan83; 08-10-2011 at 01:27 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If And Or Statement for 3 parameters

    Try:

    =IF(AND(G8="Y",H8="Y"),2.5%,IF(AND(G8="N",H8="Y"),5%,0))

    or

    =IF(H8="Y",IF(G8="Y",2.5%,5%),0)

    assuming that if H8 = n and G8 = y, then you also want 0.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If And Or Statement for 3 parameters

    How about this:

    =LOOKUP(G8&H8, {"NN", "NY", "YN", "YY"}, {0, 0, 0.05, 0.025})

    There are actually 4 possible combinations.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Contributor
    Join Date
    10-20-2005
    Posts
    127

    Re: If And Or Statement for 3 parameters

    =+IF(AND(G8="y",H8="y"),2.5%,IF(AND(G8="n",H8="y"),5%,IF(AND(G8="n",H8="n"),0,NA)))
    Regards,
    Little Master

+ 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