Countif for specific cells rather than a range ????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is this possible? I've created a 25 page worksheet to analyze cases and
dollars for 24 stores. The 25 pages are identical; the first page is a
summary of the region (the other 24 pages or stores).

I'm trying to get the averages on the summary page. So I've summarized by
adding each stores cell reference for whatever item I'm looking at. For
example
=N13+X13+AB13+AH13 etc.
and now to get the average, I want to divide by the number of stores that
are actually carrying that item. So I thought I could do a countif, counting
if the cells in that range are greater than zero. I can't seem to make this
work though.

What should this formula look like... is there an easier way to do this??
 
Is this possible? I've created a 25 page worksheet to analyze cases and
dollars for 24 stores. The 25 pages are identical; the first page is a
summary of the region (the other 24 pages or stores).

I'm trying to get the averages on the summary page. So I've summarized by
adding each stores cell reference for whatever item I'm looking at. For
example
=N13+X13+AB13+AH13 etc.
and now to get the average, I want to divide by the number of stores that
are actually carrying that item. So I thought I could do a countif, counting
if the cells in that range are greater than zero. I can't seem to make this
work though.

What should this formula look like... is there an easier way to do this??

COUNTIF is not one of the functions that will function with 3D references.

Option 1: Bring the stores cell reference for each whatever item to some out
of the way spot on your worksheet, or on another single worksheet; then use the
COUNTIF formula to refer to the cells on that sheet.

Option 2: Download Laurent Longre's free morefunc.xll add-in from
http://xcell05.free.fr/ and use his COUNTIF.3D function which allows 3D
references.


--ron
 
It couldn't be as simple as
=sum(N13+X13+AB13+AH13)/4 ???
Probably not. So you would need to provide more info. Perhaps an array
=average(if ??
 
Is this possible? I've created a 25 page worksheet to analyze cases and
dollars for 24 stores. The 25 pages are identical; the first page is a
summary of the region (the other 24 pages or stores).

I'm trying to get the averages on the summary page. So I've summarized by
adding each stores cell reference for whatever item I'm looking at. For
example
=N13+X13+AB13+AH13 etc.
and now to get the average, I want to divide by the number of stores that
are actually carrying that item. So I thought I could do a countif, counting
if the cells in that range are greater than zero. I can't seem to make this
work though.

What should this formula look like... is there an easier way to do this??

I may have misunderstood your first post.

I believe that in order to use COUNTIF, or an AVERAGE(IF(rng>0),rng)) array
function, you will need to copy those results into a contiguous range.

I do not believe that either COUNTIF or array functions can accept
non-contiguous ranges.


--ron
 
Ron Rosenfeld wrote...
....
I do not believe that either COUNTIF or array functions can accept
non-contiguous ranges.

If you get tricky enough, you can come close.

=SUMPRODUCT(COUNTIF(OFFSET(N13,0,{0,10,14,20}),whatever))

But I don't think this is what the OP is after. The OP would be vastly
better off using a database rather than a spreadsheet to calculate
conditional averages over several stores.
 
Ron Rosenfeld wrote...
...

If you get tricky enough, you can come close.

=SUMPRODUCT(COUNTIF(OFFSET(N13,0,{0,10,14,20}),whatever))

But I don't think this is what the OP is after. The OP would be vastly
better off using a database rather than a spreadsheet to calculate
conditional averages over several stores.

That is a neat trick!


--ron
 

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

Back
Top