Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How many sheets in this range

Posted on 2014-03-28
7
Medium Priority
?
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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!

 
LVL 33

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

722 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