Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Conditional Sum For Multiple Sheets

I have a (2007) workbook with around 25 Sheets in the following order:

Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"

All the branch sheets are in the same structure with column B representing
the Product like "Salt", "Sugar" etc., column C representing the Product size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.

Now I have the Covering Sheet in the following manner:
1/2 Kilo 1 Kilo 2 Kilo ... ... ...
Salt
Sugar
....
....
....

What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2 Kilo"),'Branch
1':'Branch 24'!D:D)

--

Best Regards,
FARAZ A. QURESHI
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default Conditional Sum For Multiple Sheets

Hi,

SUMPRODUCT won't work against 3D range references such as Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long spreadsheet
formula.
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"FARAZ QURESHI" wrote:

I have a (2007) workbook with around 25 Sheets in the following order:

Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"

All the branch sheets are in the same structure with column B representing
the Product like "Salt", "Sugar" etc., column C representing the Product size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.

Now I have the Covering Sheet in the following manner:
1/2 Kilo 1 Kilo 2 Kilo ... ... ...
Salt
Sugar
...
...
...

What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2 Kilo"),'Branch
1':'Branch 24'!D:D)

--

Best Regards,
FARAZ A. QURESHI

  #3   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Conditional Sum For Multiple Sheets

For one condition only:

=SUMPRODUCT(SUMIF(INDIRECT("Branch"&ROW(INDIRECT(" 1:24"))&"!
B1:B100"),"Salt",INDIRECT("Branch"&ROW(INDIRECT("1 :24"))&"!D1:D100")))

JB
http://boisgontierjacques.free.fr


On 24 jan, 09:50, Shane Devenshire
wrote:
Hi,

SUMPRODUCT won't work against 3D range references such as Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long spreadsheet
formula. *
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire



"FARAZ QURESHI" wrote:
I have a (2007) workbook with around 25 Sheets in the following order:


Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"


All the branch sheets are in the same structure with column B representing
the Product like "Salt", "Sugar" etc., column C representing the Product size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.


Now I have the Covering Sheet in the following manner:
* * * * * 1/2 Kilo * * * * *1 Kilo * * * * *2 Kilo ... ... ...
Salt
Sugar
...
...
...


What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2 Kilo"),'Branch
1':'Branch 24'!D:D)


--


Best Regards,
FARAZ A. QURESHI- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Conditional Sum For Multiple Sheets

Whether this is practical or not is for the user to decide!

For multiple SUMPRODUCT conditions across multiple sheets...

All Branch n sheets are structured as:

B2:B10 = product (text)
C2:C10 = size (text)
D2:D10 = numbers to sum (numeric)

Summary sheet:

A2 = some product name
B1 = some size

Create these named expressions:

InsertNameDefne
Name: Array1
Refers to: =COLUMN(INDIRECT("A:X"))

This evaluates to an array from 1 to 24 which corresponds to your sheet
names: Branch 1 to Branch 24

Name: Array2
Refers to: =ROW(INDIRECT("2:10"))

This is used for the OFFSET in defining the range address

Then this formula (all on one line) to sum D2:D10 across all the sheets
where B2:B10=A2 and C2:C10=B1:

Breaking it into "chunks" so that line wrap doesn't take out the space
characters after each instance of Branch.

=SUMPRODUCT(--(T(OFFSET(INDIRECT("'BRANCH "
&Array1&"'!B2:B10"),Array2-2,,))=A2),
--(T(OFFSET(INDIRECT("'Branch "&Array1&"'!C2:C10")
,Array2-2,,))=B1),N(OFFSET(INDIRECT("'Branch "
&Array1&"'!D2:D10"),Array2-2,,)))


--
Biff
Microsoft Excel MVP


"JB" wrote in message
...
For one condition only:

=SUMPRODUCT(SUMIF(INDIRECT("Branch"&ROW(INDIRECT(" 1:24"))&"!
B1:B100"),"Salt",INDIRECT("Branch"&ROW(INDIRECT("1 :24"))&"!D1:D100")))

JB
http://boisgontierjacques.free.fr


On 24 jan, 09:50, Shane Devenshire
wrote:
Hi,

SUMPRODUCT won't work against 3D range references such as Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long
spreadsheet
formula.
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire



"FARAZ QURESHI" wrote:
I have a (2007) workbook with around 25 Sheets in the following order:


Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"


All the branch sheets are in the same structure with column B
representing
the Product like "Salt", "Sugar" etc., column C representing the Product
size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.


Now I have the Covering Sheet in the following manner:
1/2 Kilo 1 Kilo 2 Kilo ... ... ...
Salt
Sugar
...
...
...


What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2
Kilo"),'Branch
1':'Branch 24'!D:D)


--


Best Regards,
FARAZ A. QURESHI- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Conditional Sum For Multiple Sheets

WOW!!!!
Biff XCLENT!!!!
By the way...

1. Why doesn't the normal text, instead of name, work? &
2. What if the size is in numerical terms instead of text?

THANK YOU VERY VERY MUCH!
--

Best Regards,
FARAZ A. QURESHI


"T. Valko" wrote:

Whether this is practical or not is for the user to decide!

For multiple SUMPRODUCT conditions across multiple sheets...

All Branch n sheets are structured as:

B2:B10 = product (text)
C2:C10 = size (text)
D2:D10 = numbers to sum (numeric)

Summary sheet:

A2 = some product name
B1 = some size

Create these named expressions:

InsertNameDefne
Name: Array1
Refers to: =COLUMN(INDIRECT("A:X"))

This evaluates to an array from 1 to 24 which corresponds to your sheet
names: Branch 1 to Branch 24

Name: Array2
Refers to: =ROW(INDIRECT("2:10"))

This is used for the OFFSET in defining the range address

Then this formula (all on one line) to sum D2:D10 across all the sheets
where B2:B10=A2 and C2:C10=B1:

Breaking it into "chunks" so that line wrap doesn't take out the space
characters after each instance of Branch.

=SUMPRODUCT(--(T(OFFSET(INDIRECT("'BRANCH "
&Array1&"'!B2:B10"),Array2-2,,))=A2),
--(T(OFFSET(INDIRECT("'Branch "&Array1&"'!C2:C10")
,Array2-2,,))=B1),N(OFFSET(INDIRECT("'Branch "
&Array1&"'!D2:D10"),Array2-2,,)))


--
Biff
Microsoft Excel MVP


"JB" wrote in message
...
For one condition only:

=SUMPRODUCT(SUMIF(INDIRECT("Branch"&ROW(INDIRECT(" 1:24"))&"!
B1:B100"),"Salt",INDIRECT("Branch"&ROW(INDIRECT("1 :24"))&"!D1:D100")))

JB
http://boisgontierjacques.free.fr


On 24 jan, 09:50, Shane Devenshire
wrote:
Hi,

SUMPRODUCT won't work against 3D range references such as Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long
spreadsheet
formula.
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire



"FARAZ QURESHI" wrote:
I have a (2007) workbook with around 25 Sheets in the following order:


Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"


All the branch sheets are in the same structure with column B
representing
the Product like "Salt", "Sugar" etc., column C representing the Product
size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.


Now I have the Covering Sheet in the following manner:
1/2 Kilo 1 Kilo 2 Kilo ... ... ...
Salt
Sugar
...
...
...


What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2
Kilo"),'Branch
1':'Branch 24'!D:D)


--


Best Regards,
FARAZ A. QURESHI- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Conditional Sum For Multiple Sheets

1. Why doesn't the normal text, instead of name, work?

Are you referring to Array1 and Array2? I used those names to shorten the
overall length of the formula.

2. What if the size is in numerical terms instead of text?


Then you'd change the T function for that array to the N function.

Whatever data type you're testing for in a particular array determines which
of those functions to use:

Arrays that are TEXT use the T function
Arrays that are NUMERIC use the N function


--
Biff
Microsoft Excel MVP


"FARAZ QURESHI" wrote in message
...
WOW!!!!
Biff XCLENT!!!!
By the way...

1. Why doesn't the normal text, instead of name, work? &
2. What if the size is in numerical terms instead of text?

THANK YOU VERY VERY MUCH!
--

Best Regards,
FARAZ A. QURESHI


"T. Valko" wrote:

Whether this is practical or not is for the user to decide!

For multiple SUMPRODUCT conditions across multiple sheets...

All Branch n sheets are structured as:

B2:B10 = product (text)
C2:C10 = size (text)
D2:D10 = numbers to sum (numeric)

Summary sheet:

A2 = some product name
B1 = some size

Create these named expressions:

InsertNameDefne
Name: Array1
Refers to: =COLUMN(INDIRECT("A:X"))

This evaluates to an array from 1 to 24 which corresponds to your sheet
names: Branch 1 to Branch 24

Name: Array2
Refers to: =ROW(INDIRECT("2:10"))

This is used for the OFFSET in defining the range address

Then this formula (all on one line) to sum D2:D10 across all the sheets
where B2:B10=A2 and C2:C10=B1:

Breaking it into "chunks" so that line wrap doesn't take out the space
characters after each instance of Branch.

=SUMPRODUCT(--(T(OFFSET(INDIRECT("'BRANCH "
&Array1&"'!B2:B10"),Array2-2,,))=A2),
--(T(OFFSET(INDIRECT("'Branch "&Array1&"'!C2:C10")
,Array2-2,,))=B1),N(OFFSET(INDIRECT("'Branch "
&Array1&"'!D2:D10"),Array2-2,,)))


--
Biff
Microsoft Excel MVP


"JB" wrote in message
...
For one condition only:

=SUMPRODUCT(SUMIF(INDIRECT("Branch"&ROW(INDIRECT(" 1:24"))&"!
B1:B100"),"Salt",INDIRECT("Branch"&ROW(INDIRECT("1 :24"))&"!D1:D100")))

JB
http://boisgontierjacques.free.fr


On 24 jan, 09:50, Shane Devenshire
wrote:
Hi,

SUMPRODUCT won't work against 3D range references such as
Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long
spreadsheet
formula.
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire



"FARAZ QURESHI" wrote:
I have a (2007) workbook with around 25 Sheets in the following
order:

Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"

All the branch sheets are in the same structure with column B
representing
the Product like "Salt", "Sugar" etc., column C representing the
Product
size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing
the
Amount of Sales.

Now I have the Covering Sheet in the following manner:
1/2 Kilo 1 Kilo 2 Kilo ... ... ...
Salt
Sugar
...
...
...

What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like
=SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2
Kilo"),'Branch
1':'Branch 24'!D:D)

--

Best Regards,
FARAZ A. QURESHI- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -






  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default Conditional Sum For Multiple Sheets

I am using a very similar function

=SUMPRODUCT(SUMIF((INDIRECT("'"&List&"'!A4:A35")), "Black",INDIRECT("'"&List&"'!B4:B35")))

Where "List" is a specific list of worksheets. However "List" isn't
completely filled out, I am continually adding sheets and these are appended
to "List." This formula works, except for the cells without any value in
"List" excel returns a "REF! error. Is it possible to embed an ISERROR() or
IFERROR() into this function?

"JB" wrote:

For one condition only:

=SUMPRODUCT(SUMIF(INDIRECT("Branch"&ROW(INDIRECT(" 1:24"))&"!
B1:B100"),"Salt",INDIRECT("Branch"&ROW(INDIRECT("1 :24"))&"!D1:D100")))

JB
http://boisgontierjacques.free.fr


On 24 jan, 09:50, Shane Devenshire
wrote:
Hi,

SUMPRODUCT won't work against 3D range references such as Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long spreadsheet
formula.
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire



"FARAZ QURESHI" wrote:
I have a (2007) workbook with around 25 Sheets in the following order:


Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"


All the branch sheets are in the same structure with column B representing
the Product like "Salt", "Sugar" etc., column C representing the Product size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.


Now I have the Covering Sheet in the following manner:
1/2 Kilo 1 Kilo 2 Kilo ... ... ...
Salt
Sugar
...
...
...


What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2 Kilo"),'Branch
1':'Branch 24'!D:D)


--


Best Regards,
FARAZ A. QURESHI- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -



  #8   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default Conditional Sum For Multiple Sheets

Use dynamic ranged for List (in column E):

=Offset($E$2,,,CountA($E:$E)-1)

JB

On 17 fév, 00:31, mitch wrote:
I am using a very similar function

=SUMPRODUCT(SUMIF((INDIRECT("'"&List&"'!A4:A35")), "Black",INDIRECT("'"&List*&"'!B4:B35")))

Where "List" is a specific list of worksheets. However "List" isn't
completely filled out, I am continually adding sheets and these are appended
to "List." This formula works, except for the cells without any value in
"List" excel returns a "REF! error. Is it possible to embed an ISERROR() or
IFERROR() into this function?



"JB" wrote:
For one condition only:


=SUMPRODUCT(SUMIF(INDIRECT("Branch"&ROW(INDIRECT(" 1:24"))&"!
B1:B100"),"Salt",INDIRECT("Branch"&ROW(INDIRECT("1 :24"))&"!D1:D100")))


JB
http://boisgontierjacques.free.fr


On 24 jan, 09:50, Shane Devenshire
wrote:
Hi,


SUMPRODUCT won't work against 3D range references such as Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long spreadsheet
formula. *
--
If this helps, please click the Yes button


Cheers,
Shane Devenshire


"FARAZ QURESHI" wrote:
I have a (2007) workbook with around 25 Sheets in the following order:


Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"


All the branch sheets are in the same structure with column B representing
the Product like "Salt", "Sugar" etc., column C representing the Product size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.


Now I have the Covering Sheet in the following manner:
* * * * * 1/2 Kilo * * * * *1 Kilo * * * * *2 Kilo ... ... ...
Salt
Sugar
...
...
...


What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2 Kilo"),'Branch
1':'Branch 24'!D:D)


--


Best Regards,
FARAZ A. QURESHI- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default Conditional Sum For Multiple Sheets

I figured it out just as you responded...I've never used Dynamic ranges
before but they are fantastic!

"JB" wrote:

Use dynamic ranged for List (in column E):

=Offset($E$2,,,CountA($E:$E)-1)

JB

On 17 fév, 00:31, mitch wrote:
I am using a very similar function

=SUMPRODUCT(SUMIF((INDIRECT("'"&List&"'!A4:A35")), "Black",INDIRECT("'"&ListÂ*&"'!B4:B35")))

Where "List" is a specific list of worksheets. However "List" isn't
completely filled out, I am continually adding sheets and these are appended
to "List." This formula works, except for the cells without any value in
"List" excel returns a "REF! error. Is it possible to embed an ISERROR() or
IFERROR() into this function?



"JB" wrote:
For one condition only:


=SUMPRODUCT(SUMIF(INDIRECT("Branch"&ROW(INDIRECT(" 1:24"))&"!
B1:B100"),"Salt",INDIRECT("Branch"&ROW(INDIRECT("1 :24"))&"!D1:D100")))


JB
http://boisgontierjacques.free.fr


On 24 jan, 09:50, Shane Devenshire
wrote:
Hi,


SUMPRODUCT won't work against 3D range references such as Sheet1:Sheet5!A1
so your best choice would be a custom function or a relative long spreadsheet
formula.
--
If this helps, please click the Yes button


Cheers,
Shane Devenshire


"FARAZ QURESHI" wrote:
I have a (2007) workbook with around 25 Sheets in the following order:


Sheet1 named "Main"
Sheet2-Sheet25 named "Branch 1" to "Branch 24"


All the branch sheets are in the same structure with column B representing
the Product like "Salt", "Sugar" etc., column C representing the Product size
like "1/2 Kilo", "1 Kilo" etc. and finally the column D representing the
Amount of Sales.


Now I have the Covering Sheet in the following manner:
1/2 Kilo 1 Kilo 2 Kilo ... ... ...
Salt
Sugar
...
...
...


What sort of formula should be placed in the B2:Last so as to sum the
relevant data from ALL the sheets? Something like =SUMPRODUCT(--('Branch
1':'Branch 24'!B:B="Salt")*--('Branch 1':'Branch 24'!C:C="1/2 Kilo"),'Branch
1':'Branch 24'!D:D)


--


Best Regards,
FARAZ A. QURESHI- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -



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
SUMPRODUCT, SUMIF, COUNTIF for multiple sheets for multiple criter Greg in CO[_2_] Excel Worksheet Functions 0 September 18th 08 05:51 PM
Conditional Formatting using multiple sheets kwinston Excel Worksheet Functions 3 April 16th 07 07:26 PM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
Why Not Conditional Formatting For Multiple Sheets? Mhz New Users to Excel 2 July 13th 06 01:27 PM
Conditional Sum and multiple conditions across different sheets Michael Dreher Excel Worksheet Functions 1 May 26th 05 05:25 PM


All times are GMT +1. The time now is 10:50 AM.

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

About Us

"It's about Microsoft Excel"