+ Reply to Thread
Results 1 to 6 of 6

SUMIF Formula w/ OR Criteria

  1. #1
    SJT
    Guest

    SUMIF Formula w/ OR Criteria

    I have written the following formula =SUMIF(B5:B21,"partner",D5:D21) but
    would like to include an OR criteria
    =SUMIF(B5:B21,OR("partner","manager"),D5:D21) but it gives me an incorrect
    value of zero. The first formula above yields the correct answer of "7500".
    Is my syntax incorrect? Thank you in advance for your assistance.

  2. #2
    Dave Peterson
    Guest

    Re: SUMIF Formula w/ OR Criteria

    One way:

    =SUM(SUMIF(B5:B21,{"partner","manager"},D5:D21))



    SJT wrote:
    >
    > I have written the following formula =SUMIF(B5:B21,"partner",D5:D21) but
    > would like to include an OR criteria
    > =SUMIF(B5:B21,OR("partner","manager"),D5:D21) but it gives me an incorrect
    > value of zero. The first formula above yields the correct answer of "7500".
    > Is my syntax incorrect? Thank you in advance for your assistance.


    --

    Dave Peterson

  3. #3
    Rob
    Guest

    Re: SUMIF Formula w/ OR Criteria

    You could simply use
    =SUMIF(B5:B21,"partner",D5:D21)+SUMIF(B5:B21,"manager",D5:D21)
    But I reckon there may be another way.......anyone?

    Rob


    "SJT" <[email protected]> wrote in message
    news:[email protected]...
    >I have written the following formula =SUMIF(B5:B21,"partner",D5:D21) but
    > would like to include an OR criteria
    > =SUMIF(B5:B21,OR("partner","manager"),D5:D21) but it gives me an incorrect
    > value of zero. The first formula above yields the correct answer of
    > "7500".
    > Is my syntax incorrect? Thank you in advance for your assistance.




  4. #4
    SJT
    Guest

    Re: SUMIF Formula w/ OR Criteria

    Thanks. What is the function that the "{" serve in your formula?

    "Dave Peterson" wrote:

    > One way:
    >
    > =SUM(SUMIF(B5:B21,{"partner","manager"},D5:D21))
    >
    >
    >
    > SJT wrote:
    > >
    > > I have written the following formula =SUMIF(B5:B21,"partner",D5:D21) but
    > > would like to include an OR criteria
    > > =SUMIF(B5:B21,OR("partner","manager"),D5:D21) but it gives me an incorrect
    > > value of zero. The first formula above yields the correct answer of "7500".
    > > Is my syntax incorrect? Thank you in advance for your assistance.

    >
    > --
    >
    > Dave Peterson
    >


  5. #5
    Dave Peterson
    Guest

    Re: SUMIF Formula w/ OR Criteria

    It tells excel to treat that as an array.

    Put some test data in A1:A2
    put this in A3: =a1:a2
    select A3, hit F2 and then hit F9.

    Look at what you see in the formula bar.



    SJT wrote:
    >
    > Thanks. What is the function that the "{" serve in your formula?
    >
    > "Dave Peterson" wrote:
    >
    > > One way:
    > >
    > > =SUM(SUMIF(B5:B21,{"partner","manager"},D5:D21))
    > >
    > >
    > >
    > > SJT wrote:
    > > >
    > > > I have written the following formula =SUMIF(B5:B21,"partner",D5:D21) but
    > > > would like to include an OR criteria
    > > > =SUMIF(B5:B21,OR("partner","manager"),D5:D21) but it gives me an incorrect
    > > > value of zero. The first formula above yields the correct answer of "7500".
    > > > Is my syntax incorrect? Thank you in advance for your assistance.

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

  6. #6
    SJT
    Guest

    Re: SUMIF Formula w/ OR Criteria

    Thanks for all the help.

    "Dave Peterson" wrote:

    > It tells excel to treat that as an array.
    >
    > Put some test data in A1:A2
    > put this in A3: =a1:a2
    > select A3, hit F2 and then hit F9.
    >
    > Look at what you see in the formula bar.
    >
    >
    >
    > SJT wrote:
    > >
    > > Thanks. What is the function that the "{" serve in your formula?
    > >
    > > "Dave Peterson" wrote:
    > >
    > > > One way:
    > > >
    > > > =SUM(SUMIF(B5:B21,{"partner","manager"},D5:D21))
    > > >
    > > >
    > > >
    > > > SJT wrote:
    > > > >
    > > > > I have written the following formula =SUMIF(B5:B21,"partner",D5:D21) but
    > > > > would like to include an OR criteria
    > > > > =SUMIF(B5:B21,OR("partner","manager"),D5:D21) but it gives me an incorrect
    > > > > value of zero. The first formula above yields the correct answer of "7500".
    > > > > Is my syntax incorrect? Thank you in advance for your assistance.
    > > >
    > > > --
    > > >
    > > > Dave Peterson
    > > >

    >
    > --
    >
    > Dave Peterson
    >


+ 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