+ Reply to Thread
Results 1 to 5 of 5

Why doesn't this nested IF statement work?

  1. #1
    Brandoni
    Guest

    Why doesn't this nested IF statement work?

    I have six columns next to each other and am trying to add date based on the
    month in every other column.

    M8 N8 O8 P8 Q8 R8
    $200 April $100 May $100 April

    Then trying to have the formula add any combination of M8,08 and Q8 that
    have "April" next to them. So the formula checks to see if it should add all
    three, or two, or just one. In this example, the returned result should be
    $300.

    I keep getting an error. Any help?

    =IF(N8="April",IF(P8="April",IF(R8="April",(M8+O8+Q8),if(N8="April",IF(P8="April",(M8+O8),(IF(N8="April",IF(R8="April",((M8+Q8),IF(N8="April",M8,IF(P8="April",o8,IF(R8="April",Q8,0),0),0),0),0),0),0),0),0),0),0),0)

  2. #2
    Miguel Zapico
    Guest

    RE: Why doesn't this nested IF statement work?

    You may use a simpler formula like:
    =if(N8="April",M8,0)+if(P8="April",O8,0)+if(R8="April",Q8,0)

    "Brandoni" wrote:

    > I have six columns next to each other and am trying to add date based on the
    > month in every other column.
    >
    > M8 N8 O8 P8 Q8 R8
    > $200 April $100 May $100 April
    >
    > Then trying to have the formula add any combination of M8,08 and Q8 that
    > have "April" next to them. So the formula checks to see if it should add all
    > three, or two, or just one. In this example, the returned result should be
    > $300.
    >
    > I keep getting an error. Any help?
    >
    > =IF(N8="April",IF(P8="April",IF(R8="April",(M8+O8+Q8),if(N8="April",IF(P8="April",(M8+O8),(IF(N8="April",IF(R8="April",((M8+Q8),IF(N8="April",M8,IF(P8="April",o8,IF(R8="April",Q8,0),0),0),0),0),0),0),0),0),0),0),0)


  3. #3
    Kevin Vaughn
    Guest

    RE: Why doesn't this nested IF statement work?

    Try this one:

    =M8*(N8="April")+O8*(P8="April")+Q8*(R8="April")
    The answer to your question is you probably have too many nested Ifs (only 7
    are allowed.) A quick glance at it indicates you do.
    --
    Kevin Vaughn


    "Brandoni" wrote:

    > I have six columns next to each other and am trying to add date based on the
    > month in every other column.
    >
    > M8 N8 O8 P8 Q8 R8
    > $200 April $100 May $100 April
    >
    > Then trying to have the formula add any combination of M8,08 and Q8 that
    > have "April" next to them. So the formula checks to see if it should add all
    > three, or two, or just one. In this example, the returned result should be
    > $300.
    >
    > I keep getting an error. Any help?
    >
    > =IF(N8="April",IF(P8="April",IF(R8="April",(M8+O8+Q8),if(N8="April",IF(P8="April",(M8+O8),(IF(N8="April",IF(R8="April",((M8+Q8),IF(N8="April",M8,IF(P8="April",o8,IF(R8="April",Q8,0),0),0),0),0),0),0),0),0),0),0),0)


  4. #4
    Don Guillett
    Guest

    Re: Why doesn't this nested IF statement work?

    for this simple example, a simple solution
    =IF(B2="April",A2)+IF(D2="April",D2)+IF(F2="April",E2)

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "Brandoni" <Brandoni@discussions.microsoft.com> wrote in message
    news:6AF48AAC-8FAA-40A2-AE57-911C4F51A171@microsoft.com...
    >I have six columns next to each other and am trying to add date based on
    >the
    > month in every other column.
    >
    > M8 N8 O8 P8 Q8 R8
    > $200 April $100 May $100 April
    >
    > Then trying to have the formula add any combination of M8,08 and Q8 that
    > have "April" next to them. So the formula checks to see if it should add
    > all
    > three, or two, or just one. In this example, the returned result should
    > be
    > $300.
    >
    > I keep getting an error. Any help?
    >
    > =IF(N8="April",IF(P8="April",IF(R8="April",(M8+O8+Q8),if(N8="April",IF(P8="April",(M8+O8),(IF(N8="April",IF(R8="April",((M8+Q8),IF(N8="April",M8,IF(P8="April",o8,IF(R8="April",Q8,0),0),0),0),0),0),0),0),0),0),0),0)




  5. #5
    Bob Phillips
    Guest

    Re: Why doesn't this nested IF statement work?

    =SUMPRODUCT(SUMIF(INDIRECT({"N8","P8","R8"}),"April",INDIRECT({"M8","O8","Q8
    "})))

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Brandoni" <Brandoni@discussions.microsoft.com> wrote in message
    news:6AF48AAC-8FAA-40A2-AE57-911C4F51A171@microsoft.com...
    > I have six columns next to each other and am trying to add date based on

    the
    > month in every other column.
    >
    > M8 N8 O8 P8 Q8 R8
    > $200 April $100 May $100 April
    >
    > Then trying to have the formula add any combination of M8,08 and Q8 that
    > have "April" next to them. So the formula checks to see if it should add

    all
    > three, or two, or just one. In this example, the returned result should

    be
    > $300.
    >
    > I keep getting an error. Any help?
    >
    >

    =IF(N8="April",IF(P8="April",IF(R8="April",(M8+O8+Q8),if(N8="April",IF(P8="A
    pril",(M8+O8),(IF(N8="April",IF(R8="April",((M8+Q8),IF(N8="April",M8,IF(P8="
    April",o8,IF(R8="April",Q8,0),0),0),0),0),0),0),0),0),0),0),0)



+ 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