Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How many sheets in this range

Posted on 2014-03-28
7
Medium Priority
?
149 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 34

Accepted Solution

by:
Rob Henson earned 1200 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 400 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 400 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

Technology Partners: 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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

963 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