View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Del Cotter Del Cotter is offline
external usenet poster
 
Posts: 560
Default Summing a binary truth list

On Tue, 2 Oct 2007, in microsoft.public.excel.worksheet.functions,
Bob Phillips said:

B only

=SUMIF(B:B,"B",D:D)

which assumes that B's Ys are in column B, the values in column D

A&B

=SUMPRODUCT(--(B1:B100="Y"),--(C1:C100="Y"),D1:D100)


Yes, I'm quite capable of applying a custom solution by hand for each
row, using my eye and human judgment to decide which function applies to
which row. I think you and Elkar missed the point of "elegant".

SUMPRODUCT or some array function with curly brackets feels like it
should be the way to go, but I was surprised I wasn't able to see my way
toward such a function. The ideal winner would be trivially simple to
modify for a table of four columns of Yes/No, having sixteen rows, and
so forth.

--
Del Cotter
NB Personal replies to this post will send email to ,
which goes to a spam folder-- please send your email to del3 instead.