Solved

How many sheets in this range

Posted on 2014-03-28
7
139 Views
Last Modified: 2014-03-31
Hi,

See formula below - which covers a group of excel sheets.

=SUM('Sheet1:Sheet20'!B12)

This add up the value in B12 from 20 different sheets (approx).  However, I may add or delete sheets.

QUESTION: I want another formula which COUNTS the number of sheets in this range.

How do I write a formula that simply tells me how many sheets are in the range - as it wont always be 20.
0
Comment
Question by:Patrick O'Dea
7 Comments
 
LVL 4

Expert Comment

by:Jorgen
ID: 39960984
Created a named formula and use an old XLM 4 command =GET.WORKBOOK(4)
0
 
LVL 4

Expert Comment

by:Jorgen
ID: 39960994
To be a little more specific.

By creating a named formula go to Formulas -> Name Manager -> Type a name e.g. NumSheets and in the refers to type in =GET.WORKBOOK(4)

Then you can concatenate you sum formula to include the first sheet up until the number specified.

If you need help with the concatenation - please let me know.

regards

Jørgen
0
 

Author Comment

by:Patrick O'Dea
ID: 39961170
Thanks Jørgen ,

I don't follow you explanation ....

Any chance you could attach a very simple example.

Thanks again,
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Accepted Solution

by:
Rob Henson earned 300 total points
ID: 39961422
You can use the COUNTA function to tell you how many cells the sum is using:

=COUNTA('Sheet1:Sheet20'!B12)

Doesn't necessarily tell you how many sheets but does tell you how many of the sheets in that range contain something.

Thanks
Rob H
0
 
LVL 39

Assisted Solution

by:nutsch
nutsch earned 100 total points
ID: 39961870
Details on Jorgen's point:

on your workshoot, do Ctrl+F3 to access name manager, click New, put Name = CountSheets, in RefersTo, put =GET.WORKBOOK(4)

OK, CLose

in your worksheet, you can now use =CountSheets and it will give you the number of worksheets in the workbok.

Warning: it's the total number of worksheets in the workbook, including some that are not in your range, and any hidden sheets too.

Thomas
0
 
LVL 4

Assisted Solution

by:Jorgen
Jorgen earned 100 total points
ID: 39965993
Dewsbury

Thomas is correct about the issues, that he states regarding hidden workbooks, as well as the issue about including counting workbooks that is included for other purposes.

I also did a little more research on concatenating to do 3D sum calculation, and it is actually more complex than I thought I have created beforehand. If that is the solution, you want, I will try to guide you, but I might have a much simpler solution for you. This solution has worked for one of my clients for years.

At my clients side we created a copy of the other sheets on our summary sheet, - that was always placed as the last sheet. We did not put in any figures, but that meant you would always know your first and your last sheetname

I have included an example - and as you can see in ark4 (sheet4) I have hidden column A, and then summarises in column B. But I sum all cell A1 in cell B1 and thereby I always know the first name and the last name of the sheets.

If you do not control which sheet is the last one - we can do that in VBA.

Reconsidering your question - I believe that the simpler solution will be easier to understand for somebody taking over your job the day you want to move on.

regards

Jørgen
Sum-Sheets.xlsx
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 39967546
Thanks all for your help.  Rob Hensons solution worked best for me.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question