View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Jerry W. Lewis Jerry W. Lewis is offline
external usenet poster
 
Posts: 837
Default Counting cells with a calculated value.

If I correctly understand what you are asking, try something like
=SUMPRODUCT(--(H1:H1000=C1:C1000+H1:H1000+2))
or
=SUMPRODUCT(ISNUMBER(H1:H1000)*(H1:H1000=C1:C1000 +H1:H1000+2))

These array formulas use the fact that the logical values TRUE and FALSE can
be coerced into the numbers 1 and 0, allowing you to count the number of
times that the condition is true by simply summing. The first formula uses
-- to force the coercion, since logical values would normally be ignored by
sum functions. The second formula doesn't need it because the multiplication
(requires both conditions be met, i.e. AND) coerces the type conversion as a
by-product.

Note that the condition
H1:H1000=C1:C1000+H1:H1000+2
can be simplified to
C1:C1000<=2

Jerry

"dugasyl" wrote:

I have been trying without success to do the following in 2007:

Count cells in a named range (Col."H" abt 300 out of 1000 lines containing
data) that are = to columns "(C+H)+2". The format is "Currency" in both
columns. I'm sure there is a way, but........

Thanks

--
Sylvio