Originally Posted by
ebaines
One way is to use the "SUM" function as an array. The following would do it for you - in this example the distances of the races are assumned to be listed in cells A1 through A6 and the corresponding finishing places in cells B1 through B6:
{=SUM((A1:A6="1 1/2 mile")*(B1:B6=1))}
To make this work you do not actually type the beginning and ending curly braces, but rather after typing the rest of the formula you hit CNTL-SHIFT-ENTER (rather than just plain ENTER), and that tells Excel to treat this as an array formula. Excel then adds the curly braces. If you type the braces yourself it won't work.
Of course you can use cell references in place of the hard-coded condition; so for example if cell a10= "1 1/2 mile" and cell b10 = 1 this would work:
{=SUM((A1:A6=A10)*(B1:B6=B10))}
That way you could simply type the conditions that you're trying to count in cells A10 and B10 and not have to edit the formula.
Hope this helps!