+ Reply to Thread
Results 1 to 6 of 6

SUMPRODUCT and OR operator

  1. #1
    Madiya
    Guest

    SUMPRODUCT and OR operator

    I need to count the no of cells that has Col A=yes and (Either Col G or
    Col H )=yes.
    This is somewhat different then using OR operator in the same
    column(like Col G=red or blue should be counted). What I want is If
    cell value in any of the col in same row is yes then it sould be
    counted.
    for e.g. if Row 15 has in
    col G yes and col H nil - counted
    col G nil and col H nil - not counted
    col G yes and col H yes - counted
    col G nil and col H yes - counted

    I hope I have clearly explained my problem. How can I do it?

    Regards,
    Madiya


  2. #2
    Ardus Petus
    Guest

    Re: SUMPRODUCT and OR operator

    Try:
    =SUMPRODUCT((A1:A5="yes")*((G1:G5="yes")+(H1:H5="Yes")>0))

    HTH
    --
    AP

    "Madiya" <[email protected]> a écrit dans le message de news:
    [email protected]...
    >I need to count the no of cells that has Col A=yes and (Either Col G or
    > Col H )=yes.
    > This is somewhat different then using OR operator in the same
    > column(like Col G=red or blue should be counted). What I want is If
    > cell value in any of the col in same row is yes then it sould be
    > counted.
    > for e.g. if Row 15 has in
    > col G yes and col H nil - counted
    > col G nil and col H nil - not counted
    > col G yes and col H yes - counted
    > col G nil and col H yes - counted
    >
    > I hope I have clearly explained my problem. How can I do it?
    >
    > Regards,
    > Madiya
    >




  3. #3
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Its not an elegant solution and I am sure there must be a shorter one, but for expediency try

    =SUMPRODUCT((A3:A7="Yes")*(G3:G7="Y"))+SUMPRODUCT((A3:A7="Yes")*(H3:H7="Y"))-SUMPRODUCT((A3:A7="Y")*(G3:G7="Y")*(H3:H7="Yes"))

    Extend your ranges accordingly

    Regards

    Dav

  4. #4
    Bob Phillips
    Guest

    Re: SUMPRODUCT and OR operator

    Madiya,

    =SUMPRODUCT(--(COUNTIF(OFFSET(A1,,ROW(INDIRECT("1:15")),10),"yes")))

    change the 1:15 to refer to the rows you want to count, and the following
    ,10 to refer to the columns to check

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Madiya" <[email protected]> wrote in message
    news:[email protected]...
    > I need to count the no of cells that has Col A=yes and (Either Col G or
    > Col H )=yes.
    > This is somewhat different then using OR operator in the same
    > column(like Col G=red or blue should be counted). What I want is If
    > cell value in any of the col in same row is yes then it sould be
    > counted.
    > for e.g. if Row 15 has in
    > col G yes and col H nil - counted
    > col G nil and col H nil - not counted
    > col G yes and col H yes - counted
    > col G nil and col H yes - counted
    >
    > I hope I have clearly explained my problem. How can I do it?
    >
    > Regards,
    > Madiya
    >




  5. #5

    Re: SUMPRODUCT and OR operator

    Hello Madiya,

    =SUMPRODUCT(--(A1:A99="Yes"),SIGN(--(G1:G99="Yes")--(H1:H99="Yes")))

    HTH,
    Bernd


  6. #6
    Don Guillett
    Guest

    Re: SUMPRODUCT and OR operator

    does this work?
    =SUMPRODUCT((a2:a14="Y")*(g2:h14="Y"))

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Madiya" <[email protected]> wrote in message
    news:[email protected]...
    >I need to count the no of cells that has Col A=yes and (Either Col G or
    > Col H )=yes.
    > This is somewhat different then using OR operator in the same
    > column(like Col G=red or blue should be counted). What I want is If
    > cell value in any of the col in same row is yes then it sould be
    > counted.
    > for e.g. if Row 15 has in
    > col G yes and col H nil - counted
    > col G nil and col H nil - not counted
    > col G yes and col H yes - counted
    > col G nil and col H yes - counted
    >
    > I hope I have clearly explained my problem. How can I do it?
    >
    > Regards,
    > Madiya
    >




+ 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