Excel help

%3CLINGO-SUB%20id%3D%22lingo-sub-1518292%22%20slang%3D%22en-US%22%3EExcel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518292%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Everyone%3C%2FP%3E%3CP%3EI%20have%20some%20simple%20data%20on%20services%20delivered%20over%20time%20to%20individual%20people%20(ID%201%20to%2018)%20and%20the%20community%20group%20they%20belong%20to%26nbsp%3B(A%20to%20F).%20Rows%20are%20service%20dates%20for%20an%20individual%20person.%3C%2FP%3E%3CP%3EI'm%20trying%20to%20to%20get%20a%20count%20of%20the%20number%20of%20service%20dates%20where%20the%20individual%20is%20a%20member%20of%20one%20or%20more%20of%20the%20communities%20-%20if%20the%20person%20is%20a%20member%20of%20more%20than%20one%20I%20only%20want%20to%20count%20one%20of%20them%20on%20the%20service%20date%20-%20so%20i%20think%20I%20want%20an%20OR%20function.%20For%20the%20data%20below%20the%20answer%20should%20be%20that%20there%20are%2017%20instances%20where%20a%20service%20was%20delivered%20to%20a%20person%20from%20one%20of%20the%20communities.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20several%20things%20including%3C%2FP%3E%3CP%3E%3DSUMPRODUCT((E6%3AE132%3D%22Yes%22)%20%2B%20(F6%3AF132%3D%22Yes%22)%20%2B%20(G6%3AG132%3D%22Yes%22)%20%2B%20(H6%3AH132%3D%22Yes%22)%20%2B%20(I6%3AI132%3D%22Yes%22)%20%2B%20(J6%3AJ132%3D%22Yes%22))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%26nbsp%3B%3DCOUNTIFS(%24E%246%3A%24E%24131%2C%22Yes%22)%2BCOUNTIFS(%24F%246%3A%24F%24131%2C%22Yes%22)%2BCOUNTIFS(%24G%246%3A%24G%24131%2C%22Yes%22)%2BCOUNTIFS(%24H%246%3A%24H%24131%2C%22Yes%22)%2BCOUNTIFS(%24I%246%3A%24I%24131%2C%22Yes%22)%2BCOUNTIFS(%24J%246%3A%24J%24131%2C%22Yes%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20always%20come%20up%20with%20'23'%20instead%20of%20'17'%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EMark%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%20width%3D%22258%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%2264%22%3EDate%3C%2FTD%3E%3CTD%20width%3D%2238%22%3EID%3C%2FTD%3E%3CTD%20width%3D%2228%22%3EA%3C%2FTD%3E%3CTD%20width%3D%2228%22%3EB%3C%2FTD%3E%3CTD%20width%3D%2228%22%3EC%3C%2FTD%3E%3CTD%20width%3D%2216%22%3ED%3C%2FTD%3E%3CTD%20width%3D%2228%22%3EE%3C%2FTD%3E%3CTD%20width%3D%2228%22%3EF%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E1%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E2%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3CTD%3E%26nbsp%3B%3C%2FTD%3E%3C%2FTR%3E%3CTR%3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D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518328%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518328%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F726709%22%20target%3D%22_blank%22%3E%40Mark_Bartlett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20such%20sample%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20581px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205000i05AE0DD89C70C5CA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eas%20variant%20it%20could%20be%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DSUMPRODUCT(--(MMULT(--(%24C%243%3A%24H%2421%3D%22Yes%22)%2CTRANSPOSE(COLUMN(%24C%243%3A%24H%243)%2FCOLUMN(%24C%243%3A%24H%243)))%26gt%3B0))%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518474%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518474%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F726709%22%20target%3D%22_blank%22%3E%40Mark_Bartlett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEven%20in%20MS365%20the%20number%20of%20functions%20that%20take%20a%202D%20array%20and%20aggregate%20to%20give%20a%20column%20or%20row%20of%20results%20as%20an%20array%20is%20minimal%2C%20hence%20the%20somewhat%20mathematical%20matrix-multiplication%20function%20MMULT.%26nbsp%3B%20The%20formula%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D%20SUM(SIGN(MMULT(--(data%3D%22Yes%22)%2C%20--TRANSPOSE(ISTEXT(community)))))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ediffers%20from%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%20only%20in%20the%20approach%20taken%20to%20generating%20the%20column%20of%201s%20(I%20assume%20all%20data%20is%20referenced%20by%20name)%2C%20and%20the%20fact%20that%20I%20do%20not%20require%20SUMPRODUCT%20as%20an%20array%20wrapper.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20have%20access%20to%20Charles%20Williams's%20SpeedTools%20add-in%2C%20so%20I%20am%20able%20to%20experiment%20with%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D%20SUM(N(OR.ROWS(data%3D%22Yes%22)))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ewhich%20follows%20the%20logic%20of%20the%20solution%20somewhat%20better.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518556%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518556%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20shorten%20it%20a%20bit%20if%20you%20are%20on%20Office365%20Insider%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DSUM(--((MMULT(--(C3%3AH21%3D%22YES%22)%2CSEQUENCE(COUNTA(C2%3AH2)%2C1%2C1%2C0)))%26gt%3B0))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3ESam%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1518573%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1518573%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F545693%22%20target%3D%22_blank%22%3E%40excelpbi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20intentionally%20ignored%20DA%20functions.%20For%20this%20case%20they%20add%20practically%20no%20value%20but%20could%20add%20compatibility%20issues.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1519770%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1519770%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F545693%22%20target%3D%22_blank%22%3E%40excelpbi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESam%2C%20there%20are%20still%20new%20techniques%20to%20be%20developed%20using%20DA.%26nbsp%3B%20For%20example%2C%20in%20the%20present%20case%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D%20SUM(%20IFERROR((data%3D%22Yes%22)%20%2F%20COUNTIFS(%20data%2C%20%22Yes%22%2C%20ID.range%2C%20ID%20)%2C%200%20)%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Etakes%20into%20account%20the%20fact%20that%20ID%3D6%20is%20to%20be%20found%20both%20as%20record%206%20and%2019.%26nbsp%3B%20In%20order%20to%20count%20the%20two%20matches%20as%20one%2C%20the%20above%20formula%20resorts%20to%20an%20old%20'count%20unique%20trick'%20of%20dividing%20by%20the%20number%20of%20occurrences%20of%20each%20match.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%20with%20the%20formula%20is%20that%20COUNTIFS%20requires%20range%20references%20and%20NOT%20arrays%20and%2C%20moreover%2C%20the%20criteria%20ranges%20must%20be%20of%20the%20same%20type.%26nbsp%3B%20Here%20'data'%20is%20a%202D%20range%20whilst%20'ID'%20is%20a%20column.%26nbsp%3B%20There%20is%20no%20concept%20of%20'broadcasting'%20for%20ranges%20so%20the%20obvious%20formula%20fails.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20did%20to%20make%20the%20formula%20work%20is%20to%20create%20a%20dynamic%20helper%20range%20'ID.range'%20on%20another%20sheet%20using%20the%20formula%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D%20IF(ISTEXT(community)%2C%20ID)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20this%20is%20merely%20a%20computational%20device%20of%20no%20interest%20in%20terms%20of%20the%20logic%20of%20the%20solution%2C%20the%20sheet%20can%20be%20hidden%20or%20even%20'very%20hidden'.%26nbsp%3B%20In%20practice%2C%20the%20name%20'ID.range'%20referred%20to%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DHelper!%24A%241%23%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EIs%20it%20worth%20the%20effort%3F%26nbsp%3B%20Well%2C%20it%20changes%20the%20result%20to%2016.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi Everyone

I have some simple data on services delivered over time to individual people (ID 1 to 18) and the community group they belong to (A to F). Rows are service dates for an individual person.

I'm trying to to get a count of the number of service dates where the individual is a member of one or more of the communities - if the person is a member of more than one I only want to count one of them on the service date - so i think I want an OR function. For the data below the answer should be that there are 17 instances where a service was delivered to a person from one of the communities.

 

I've tried several things including

=SUMPRODUCT((E6:E132="Yes") + (F6:F132="Yes") + (G6:G132="Yes") + (H6:H132="Yes") + (I6:I132="Yes") + (J6:J132="Yes"))

 

and =COUNTIFS($E$6:$E$131,"Yes")+COUNTIFS($F$6:$F$131,"Yes")+COUNTIFS($G$6:$G$131,"Yes")+COUNTIFS($H$6:$H$131,"Yes")+COUNTIFS($I$6:$I$131,"Yes")+COUNTIFS($J$6:$J$131,"Yes")

 

but always come up with '23' instead of '17'

 

Please help

Thanks

Mark

 

DateIDABCDEF
 1      
 2      
 3     Yes
 4Yes    Yes
 5     Yes
 6Yes     
 7  Yes   
 8 Yes   Yes
 9Yes   Yes 
 10     Yes
 11Yes    Yes
 12Yes     
 13     Yes
 14     Yes
 15     Yes
 16Yes    Yes
 1  Yes  Yes
 18     Yes
 6     Yes
Total 6120113
5 Replies

@Mark_Bartlett 

For such sample

image.png

as variant it could be

=SUMPRODUCT(--(MMULT(--($C$3:$H$21="Yes"),TRANSPOSE(COLUMN($C$3:$H$3)/COLUMN($C$3:$H$3)))>0))

@Mark_Bartlett 

Even in MS365 the number of functions that take a 2D array and aggregate to give a column or row of results as an array is minimal, hence the somewhat mathematical matrix-multiplication function MMULT.  The formula

= SUM(SIGN(MMULT(--(data="Yes"), --TRANSPOSE(ISTEXT(community)))))

differs from @Sergei Baklan  only in the approach taken to generating the column of 1s (I assume all data is referenced by name), and the fact that I do not require SUMPRODUCT as an array wrapper.

 

I also have access to Charles Williams's SpeedTools add-in, so I am able to experiment with

= SUM(N(OR.ROWS(data="Yes")))

which follows the logic of the solution somewhat better.

 

@Sergei Baklan 

You can shorten it a bit if you are on Office365 Insider

 

=SUM(--((MMULT(--(C3:H21="YES"),SEQUENCE(COUNTA(C2:H2),1,1,0)))>0))

 

Cheers

Sam

 

 

@excelpbi 

I intentionally ignored DA functions. For this case they add practically no value but could add compatibility issues.

@excelpbi 

Sam, there are still new techniques to be developed using DA.  For example, in the present case

 

= SUM( IFERROR((data="Yes") / COUNTIFS( data, "Yes", ID.range, ID ), 0 ) )

 

takes into account the fact that ID=6 is to be found both as record 6 and 19.  In order to count the two matches as one, the above formula resorts to an old 'count unique trick' of dividing by the number of occurrences of each match.

 

The problem with the formula is that COUNTIFS requires range references and NOT arrays and, moreover, the criteria ranges must be of the same type.  Here 'data' is a 2D range whilst 'ID' is a column.  There is no concept of 'broadcasting' for ranges so the obvious formula fails.

 

What I did to make the formula work is to create a dynamic helper range 'ID.range' on another sheet using the formula

 

= IF(ISTEXT(community), ID)

 

Since this is merely a computational device of no interest in terms of the logic of the solution, the sheet can be hidden or even 'very hidden'.  In practice, the name 'ID.range' referred to 

 

=Helper!$A$1#

 

 

Is it worth the effort?  Well, it changes the result to 16.