+ Reply to Thread
Results 1 to 6 of 6

Difficult (for me) question about conditional SUM

  1. #1
    Registered User
    Join Date
    06-28-2005
    Posts
    81

    Difficult (for me) question about conditional SUM

    Hi, I'm back again asking for some help.

    I have in column A and B 2 formulas that evaluate to either true or false. In column C I have a number. Say that I have 1000 rows; i want to sum only those values in column C where valuels in column A and B in the same row are both true.

    Of course I can create a new column D where I AND booleans in A and B but This would make me create a new column ... I do not want this because in my file I have many many pairs of A & B. So I would have to create at least 25 more columns containing AND formulas...

    I need something that doesn't oblige me to create any new column

    Thanks in advance for any help

    Sorry for my english, I hope I have made myself understood.

    Paolo

    Italy

  2. #2
    Conan Kelly
    Guest

    Re: Difficult (for me) question about conditional SUM

    kayard,

    You might try this:

    =sumproduct(($A$1:$A$1000=TRUE)*($B$1:$B$1000=TRUE)*($C$1:$C$1000))

    OR

    =sumproduct(($A$1:$A$1000="TRUE")*($B$1:$B$1000="TRUE")*($C$1:$C$1000))

    Hopefully one of those will work for you.

    I hope this helps,

    Conan



    "kayard" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi, I'm back again asking for some help.
    >
    > I have in column A and B 2 formulas that evaluate to either true or
    > false. In column C I have a number. Say that I have 1000 rows; i want
    > to sum only those values in column C where valuels in column A and B
    > in the same row are both true.
    >
    > Of course I can create a new column D where I AND booleans in A and B
    > but This would make me create a new column ... I do not want this
    > because in my file I have many many pairs of A & B. So I would have to
    > create at least 25 more columns containing AND formulas...
    >
    > I need something that doesn't oblige me to create any new column
    >
    > Thanks in advance for any help
    >
    > Sorry for my english, I hope I have made myself understood.
    >
    > Paolo
    >
    > Italy
    >
    >
    > --
    > kayard
    > ------------------------------------------------------------------------
    > kayard's Profile: http://www.excelforum.com/member.php...o&userid=24716
    > View this thread: http://www.excelforum.com/showthread...hreadid=569507
    >




  3. #3
    NickHK
    Guest

    Re: Difficult (for me) question about conditional SUM

    You don't need to explicitly test for True. Use the fact that True=1 and
    False=0 (on Excel worksheets anyway);
    =SUMPRODUCT(A1:A9*B1:B9*C1:C9)

    NickHK

    "kayard" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi, I'm back again asking for some help.
    >
    > I have in column A and B 2 formulas that evaluate to either true or
    > false. In column C I have a number. Say that I have 1000 rows; i want
    > to sum only those values in column C where valuels in column A and B
    > in the same row are both true.
    >
    > Of course I can create a new column D where I AND booleans in A and B
    > but This would make me create a new column ... I do not want this
    > because in my file I have many many pairs of A & B. So I would have to
    > create at least 25 more columns containing AND formulas...
    >
    > I need something that doesn't oblige me to create any new column
    >
    > Thanks in advance for any help
    >
    > Sorry for my english, I hope I have made myself understood.
    >
    > Paolo
    >
    > Italy
    >
    >
    > --
    > kayard
    > ------------------------------------------------------------------------
    > kayard's Profile:

    http://www.excelforum.com/member.php...o&userid=24716
    > View this thread: http://www.excelforum.com/showthread...hreadid=569507
    >




  4. #4
    Registered User
    Join Date
    06-28-2005
    Posts
    81

    [even more] Difficult (for me) question about conditional SUM

    thanks, but I actually have to make it even harder.

    Let's make this example. I have column A containing either true or false and column B containing either number or #N/A. I need a formula (if it does exist) that calculate the average of those values in column B that are valid (ie not #N/A) and whose corresponding test condition in the same row and column A is true. At this point I would accept even VBA code but i don't understand much about it so I would need some big help on that.

    Sorry for abusing your patience.

    Thanks again for your support.

    Paolo

    Italy
    Last edited by kayard; 08-09-2006 at 02:33 AM.

  5. #5
    NickHK
    Guest

    Re: Difficult (for me) question about conditional SUM

    Not sure I understand the problem.
    See the values of :
    =True*True*100
    =False*True*100
    =False*False*100

    NickHK

    "kayard" <[email protected]> wrote in
    message news:[email protected]...
    >
    > thanks, but I actually have to make it even harder.
    >
    > Let's make this example. I have column A containing either true or
    > false
    >
    >
    > --
    > kayard
    > ------------------------------------------------------------------------
    > kayard's Profile:

    http://www.excelforum.com/member.php...o&userid=24716
    > View this thread: http://www.excelforum.com/showthread...hreadid=569507
    >




  6. #6
    Registered User
    Join Date
    06-28-2005
    Posts
    81
    I'll try to explain better.

    I have in A1:A100 either numbers or #N/A. In B1:B100 there is either TRUE or FALSE. I want to calculate the average of A1:A100 but only of those rows where there is an actual number (Not #N/A) and where condition in column B is true.

    Thanks

+ 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