SOLVED

How to count the number of cells in a range where a formula result is greater than a given amount

%3CLINGO-SUB%20id%3D%22lingo-sub-2163441%22%20slang%3D%22en-US%22%3EHow%20to%20count%20the%20number%20of%20cells%20in%20a%20range%20where%20a%20formula%20result%20is%20greater%20than%20a%20given%20amount%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2163441%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20have%20a%20very%20large%20set%20of%20data%20(several%20thousand%20rows%2C%20150%20columns)%2C%20and%20I'm%20trying%20to%20come%20up%20with%20a%20way%20to%20count%20the%20number%20of%20times%20each%20row%20meets%20a%20specific%20criteria.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20essence%2C%20each%20cell%20has%20a%20number%20in%20it%2C%20and%20then%20there's%20a%20total%20row%20at%20the%20top%20that%20sums%20all%20the%20numbers%20from%20each%20column.%20I've%20used%20conditional%20formatting%20to%20highlight%20each%20cell%20in%20which%20the%20number%20in%20the%20cell%20is%20at%20least%200.1%25%20of%20the%20total%20for%20the%20column.%20What%20I%20want%20is%2C%20at%20the%20right%20side%20of%20the%20table%2C%20another%20column%20that%20displays%20how%20many%20times%20each%20row%20met%20this%20condition.%20Since%20countif%20doesn't%20appear%20to%20work%20with%20array%20formulas%2C%20a%20formula%20like%20the%20below%20doesn't%20work%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DCOUNTIF(%24B3%3A%24EM3%2F%24B%241%3A%24EM%241%2C%22%26gt%3B%3D.001%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBecause%20of%20the%20sheer%20number%20of%20columns%2C%20I'm%20really%2C%26nbsp%3B%3CEM%3Ereally%3C%2FEM%3E%20hoping%20to%20avoid%20adding%20140%2B%20helper%20columns.%20Is%20this%20something%20that%20can%20be%20done%20with%20SUMPRODUCT%2C%20and%20if%20so%2C%20what%20would%20that%20look%20like%3F%20If%20not%2C%20what%20would%20be%20the%20best%20way%20to%20go%20about%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJeff%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2163441%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Hi, I have a very large set of data (several thousand rows, 150 columns), and I'm trying to come up with a way to count the number of times each row meets a specific criteria. 

 

In essence, each cell has a number in it, and then there's a total row at the top that sums all the numbers from each column. I've used conditional formatting to highlight each cell in which the number in the cell is at least 0.1% of the total for the column. What I want is, at the right side of the table, another column that displays how many times each row met this condition. Since countif doesn't appear to work with array formulas, a formula like the below doesn't work:

 

=COUNTIF($B3:$EM3/$B$1:$EM$1,">=.001")

 

Because of the sheer number of columns, I'm really, really hoping to avoid adding 140+ helper columns. Is this something that can be done with SUMPRODUCT, and if so, what would that look like? If not, what would be the best way to go about this?

 

Thanks,

Jeff

2 Replies
best response confirmed by JeffAllen55 (New Contributor)
Solution

@JeffAllen55 

Like this:

 

=SUMPRODUCT(--($B3:$EM3/$B$1:$EM$1>=0.001))