Problem with COUNTIF

I

Iris

here goes:

A1:A8 contains numbers. A9 Contains the average of these
numbers.

I am trying to count the number of times that any data in
A1:A8 was anumber larger then the average.

Using COUTIF(A1:A8, ">A9") returns a 0

Any ideas anyone?
 
B

Bob Phillips

Iris,

Here is a slight alternative whereby you don't need the average in A9

=COUNTIF(A1:A8,">"&AVERAGE(A1:A8))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
M

matt_the_brum

I am using
=COUNTIF(Enquiries!D:D,"Jan-04")
to try and count hoe many cells from another worksheet include
January date. It is only looking for exact matches to "Jan-04" wher
as I want it to pick up all Jan dates eg 02-Jan-04, 15-Jan-04 etc.
Any suggestions
 
B

Bob Phillips

Matt,

Try this

=SUMPRODUCT((TEXT(D1:D100,"mmmm")="January")*(NOT(ISBLANK(D1:D100))))

or this

=SUMPRODUCT((MONTH(D1:D100)=1)*(NOT(ISBLANK(D1:D100))))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
R

Roger Govier

Hi Matt
Whilst you see the dates as 02-Jan-04 they are not helf as text, but as a
serial number.
Countif is looking ofr the text enclosed within your quotes hence not
finding any matches

Instead you could try
=SUMPRODUCT(--(MONTH(D1:D1000)=1))

Sumproduct will not take a complete column as its range, so change the range
to include the maximum number of cells likely to contain your data
 
R

Roger Govier

Matt,

Bob is far more awake than I am this morning.
His formula =SUMPRODUCT((MONTH(D1:D100)=1)*(NOT(ISBLANK(D1:D100))))
is correct as the blank cells would evaluate to a Month of 1 and would mess
up your answer.

--
Regards
Roger Govier
Roger Govier said:
Hi Matt
Whilst you see the dates as 02-Jan-04 they are not helf as text, but as a
serial number.
Countif is looking ofr the text enclosed within your quotes hence not
finding any matches

Instead you could try
=SUMPRODUCT(--(MONTH(D1:D1000)=1))

Sumproduct will not take a complete column as its range, so change the range
to include the maximum number of cells likely to contain your data
 
M

matt_the_brum

Thanks you lot, now seems to be working. Next step is to sum all th
cells 3 colums to the right of the ones that have just been counted a
January. This might get a bit complicated so will probably just resor
to manual selection of cells
 
F

Frank Kabel

Hi
just use the following:
=SUMPRODUCT((MONTH(D1:D100)=1)*(NOT(ISBLANK(D1:D100)))*(G1:G1000))
or
=SUMPRODUCT((MONTH(D1:D100)=1)*(NOT(ISBLANK(D1:D100))),G1:G1000)

If G is the column to sum
Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top