#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default SUMIF

Im using Excel 2003 SP2, and I have a spreadsheet which shows the monthly
management accounts for a series of cost-centres, one per worksheet; the
worksheets are named Sheet1 through to Sheet20. Each worksheet has five
columns and about a hundred rows, and their layout is identical.

I also have a worksheet that produces an account for the combined cost
centres, using =SUM(Sheet1:Sheet20!E6) etc. for each cell. So far so good.

The problem is that the cost-centres are divided into sub-groups, and I want
to produce sub-totals for each sub-group. Cell B2 on each worksheet contains
the reference for the sub-group that the particular cost centre belongs to,
ranging from 1 through to 8.

Ive used the following formula for sub-group 1, but it produces a #NAME?
error:

=SUMPRODUCT(SUMIF(INDIRECT("'"&sheet1:sheet20&"'b2 "),1,INDIRECT("'"&sheet1:sheet20&"'!e6")))

I guess the fact that Excel isnt capitalising the initial letter of the
worksheet name is a clue, but can anyone tell me what Im doing wrong?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default SUMIF

Hi Ian

From a previous posting by Biff (T Valko)

If you create a list of your sheet names and call it something like
Snames then the following formula will work

=SUMPRODUCT(SUMIF(INDIRECT("'"&Snames&"'!b2"),1,IN DIRECT("'"&Snames&"'!b6")))

--
Regards

Roger Govier


"Ian Yates" wrote in message
...
I'm using Excel 2003 SP2, and I have a spreadsheet which shows the
monthly
management accounts for a series of cost-centres, one per worksheet;
the
worksheets are named "Sheet1" through to "Sheet20. Each worksheet has
five
columns and about a hundred rows, and their layout is identical.

I also have a worksheet that produces an account for the combined cost
centres, using =SUM(Sheet1:Sheet20!E6) etc. for each cell. So far so
good.

The problem is that the cost-centres are divided into sub-groups, and
I want
to produce sub-totals for each sub-group. Cell B2 on each worksheet
contains
the reference for the sub-group that the particular cost centre
belongs to,
ranging from 1 through to 8.

I've used the following formula for sub-group 1, but it produces a
#NAME?
error:

=SUMPRODUCT(SUMIF(INDIRECT("'"&sheet1:sheet20&"'b2 "),1,INDIRECT("'"&sheet1:sheet20&"'!e6")))

I guess the fact that Excel isn't capitalising the initial letter of
the
worksheet name is a clue, but can anyone tell me what I'm doing wrong?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default SUMIF

Roger

It works! Many thanks for your help.

Ian


"Roger Govier" wrote:

Hi Ian

From a previous posting by Biff (T Valko)

If you create a list of your sheet names and call it something like
Snames then the following formula will work

=SUMPRODUCT(SUMIF(INDIRECT("'"&Snames&"'!b2"),1,IN DIRECT("'"&Snames&"'!b6")))

--
Regards

Roger Govier


"Ian Yates" wrote in message
...
I'm using Excel 2003 SP2, and I have a spreadsheet which shows the
monthly
management accounts for a series of cost-centres, one per worksheet;
the
worksheets are named "Sheet1" through to "Sheet20. Each worksheet has
five
columns and about a hundred rows, and their layout is identical.

I also have a worksheet that produces an account for the combined cost
centres, using =SUM(Sheet1:Sheet20!E6) etc. for each cell. So far so
good.

The problem is that the cost-centres are divided into sub-groups, and
I want
to produce sub-totals for each sub-group. Cell B2 on each worksheet
contains
the reference for the sub-group that the particular cost centre
belongs to,
ranging from 1 through to 8.

I've used the following formula for sub-group 1, but it produces a
#NAME?
error:

=SUMPRODUCT(SUMIF(INDIRECT("'"&sheet1:sheet20&"'b2 "),1,INDIRECT("'"&sheet1:sheet20&"'!e6")))

I guess the fact that Excel isn't capitalising the initial letter of
the
worksheet name is a clue, but can anyone tell me what I'm doing wrong?




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default SUMIF

Hi Ian

You're very welcome. Thanks for the feedback, but the thanks are really
due to Biff who posted the original solution.

--
Regards

Roger Govier


"Ian Yates" wrote in message
...
Roger

It works! Many thanks for your help.

Ian


"Roger Govier" wrote:

Hi Ian

From a previous posting by Biff (T Valko)

If you create a list of your sheet names and call it something like
Snames then the following formula will work

=SUMPRODUCT(SUMIF(INDIRECT("'"&Snames&"'!b2"),1,IN DIRECT("'"&Snames&"'!b6")))

--
Regards

Roger Govier


"Ian Yates" wrote in message
...
I'm using Excel 2003 SP2, and I have a spreadsheet which shows the
monthly
management accounts for a series of cost-centres, one per
worksheet;
the
worksheets are named "Sheet1" through to "Sheet20. Each worksheet
has
five
columns and about a hundred rows, and their layout is identical.

I also have a worksheet that produces an account for the combined
cost
centres, using =SUM(Sheet1:Sheet20!E6) etc. for each cell. So far
so
good.

The problem is that the cost-centres are divided into sub-groups,
and
I want
to produce sub-totals for each sub-group. Cell B2 on each worksheet
contains
the reference for the sub-group that the particular cost centre
belongs to,
ranging from 1 through to 8.

I've used the following formula for sub-group 1, but it produces a
#NAME?
error:

=SUMPRODUCT(SUMIF(INDIRECT("'"&sheet1:sheet20&"'b2 "),1,INDIRECT("'"&sheet1:sheet20&"'!e6")))

I guess the fact that Excel isn't capitalising the initial letter
of
the
worksheet name is a clue, but can anyone tell me what I'm doing
wrong?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sumif? flow23 Excel Discussion (Misc queries) 3 January 2nd 07 02:25 PM
SUMIF reno Excel Discussion (Misc queries) 4 February 8th 06 06:48 PM
Embedding a Sumif in a sumif C.Pflugrath Excel Worksheet Functions 5 August 31st 05 07:31 PM
nested sumif or sumif with two criteria dshigley Excel Worksheet Functions 5 April 5th 05 03:34 AM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"