COUNTIF across multiple sheets

J

J

I have a workbook that has five sheets - September. . . January. I have a
range of cells (D6:D17) where I need to count the occurrence of specific
text from all sheets . For example:

In D6:D17 sheet September has four cells with "fries", two with "malt" and
two with "shrimp", the balance of cells in the range are empty.

In D6:D17 sheet November has four cells with "malt" and all other range
cells are empty

On a sheet named Total I want to total the occurrence of "fries", "shrimp"
and "malt" on all sheets in the workbook. From the example above the total
for "malt" would show 6. Here is what Excel 97 says is the correct formula:

=COUNTIF(September:December!D5:D17,"malt")

but I keep getting a #VALUE! error. The COUNTIF works fine if I "+" together
multiple COUNTIFs but there is a potential for numerous sheets and I do not
want to have a huge formula.

Any help is appreciated.
 
J

JE McGimpsey

CountIf will not work with 3D ranges like that. One workaround:

In an out-of-the-way location in each data sheet, say, cell Z1, put

=COUNTIF(D5:D17,"malt")

(if you group all the sheets first, you can enter in all of them at the
same time). You can then hide the column if you wish.

Then in your Total sheet, enter

=SUM(September:December!Z1)
 
J

J

JE said:
CountIf will not work with 3D ranges like that. One workaround:

In an out-of-the-way location in each data sheet, say, cell Z1, put

=COUNTIF(D5:D17,"malt")

(if you group all the sheets first, you can enter in all of them at
the same time). You can then hide the column if you wish.

Then in your Total sheet, enter

=SUM(September:December!Z1)

Thanks for the help. I think the McGimpsey's suggestion is a better one for
how I have the workbook set-up now and adding sheets later.

J
 

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

Similar Threads


Top