+ Reply to Thread
Results 1 to 4 of 4

sumif and sumproduct together

  1. #1
    tina
    Guest

    sumif and sumproduct together

    Hi
    I am using sumproduct to calculate target units produced (range of std rates
    multiplied by range of actual hours) what I would like to do is only sum if
    shift is m(morning) or shift is l (late)
    example
    row col A col B col C
    1 std rate act Hrs shift
    2 1250 4.5 m
    3 1500 3.75 m
    4 1000 6.0 l
    5 2500 3 m
    there are over 40 rows and I cannot sort by shift as sorted by workcentre
    I tried =sumif(a:c,"m",sumproduct(a2:a5,B2:b5))
    but didnot work
    Any ideas
    Thanks
    Tina


  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Tina

    Try
    =SUMPRODUCT((A2:A5),(B2:B5)*(C2:C5="l"))
    =SUMPRODUCT((A2:A5),(B2:B5)*(C2:C5="m"))

    The last condition C2:C5="l" evaluates to a true of a false which when used in a formula becomes a 1 or a 0 (which is why it is multiplied by the previous expression (*) to make this happen. Obviously everything multiple by a 0 returns a 0 so it just sumproducts where it is true

    Regards

    Dav
    Last edited by Dav; 03-08-2006 at 09:30 AM.

  3. #3
    Bob Phillips
    Guest

    Re: sumif and sumproduct together

    Not advocating this, but along your thought lines

    =SUM(IF(C2:C5="m",(A2:A5)*(B2:B5)))

    which is an array formula, it should be committed with Ctrl-Shift-Enter, not
    just Enter.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "tina" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > I am using sumproduct to calculate target units produced (range of std

    rates
    > multiplied by range of actual hours) what I would like to do is only sum

    if
    > shift is m(morning) or shift is l (late)
    > example
    > row col A col B col C
    > 1 std rate act Hrs shift
    > 2 1250 4.5 m
    > 3 1500 3.75 m
    > 4 1000 6.0 l
    > 5 2500 3 m
    > there are over 40 rows and I cannot sort by shift as sorted by workcentre
    > I tried =sumif(a:c,"m",sumproduct(a2:a5,B2:b5))
    > but didnot work
    > Any ideas
    > Thanks
    > Tina
    >




  4. #4
    R..VENKATARAMAN
    Guest

    Re: sumif and sumproduct together

    =SUMPRODUCT((C2:C5="m")*(B2:B5)*(A2:A5))
    hit control+shift+enter (NOT enter only)

    instead of "m" replace "l"

    "tina" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > I am using sumproduct to calculate target units produced (range of std
    > rates
    > multiplied by range of actual hours) what I would like to do is only sum
    > if
    > shift is m(morning) or shift is l (late)
    > example
    > row col A col B col C
    > 1 std rate act Hrs shift
    > 2 1250 4.5 m
    > 3 1500 3.75 m
    > 4 1000 6.0 l
    > 5 2500 3 m
    > there are over 40 rows and I cannot sort by shift as sorted by workcentre
    > I tried =sumif(a:c,"m",sumproduct(a2:a5,B2:b5))
    > but didnot work
    > Any ideas
    > Thanks
    > Tina
    >




+ 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