Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Multisheet range in SUMPRODUCT?

When I write SUM(Sheet1:Sheet4!B4:B6), that works.

But if I change the function name to SUMPRODUCT, I get a #REF error. Copied
from the Formula Bar:

=SUMPRODUCT(Sheet1:Sheet4!B4:B6)

And if I use that form of range in a subexpression, I get a #NAME error.
Copied from the Formula Bar:

=SUMPRODUCT(--(sheet1:Sheet4!B4:B6<=20))

Note that Sheet1 is lowercased by Excel. All my changes were made by
successive minimum editing of the original SUM formula.

Is there some way to make this kind of range work with SUMPRODUCT, short of
the obvious, namely breaking this into multiple subexpressions?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 834
Default Multisheet range in SUMPRODUCT?

Try

=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))

--

HTH

Bob

"Joe User" <joeu2004 wrote in message
...
When I write SUM(Sheet1:Sheet4!B4:B6), that works.

But if I change the function name to SUMPRODUCT, I get a #REF error.
Copied from the Formula Bar:

=SUMPRODUCT(Sheet1:Sheet4!B4:B6)

And if I use that form of range in a subexpression, I get a #NAME error.
Copied from the Formula Bar:

=SUMPRODUCT(--(sheet1:Sheet4!B4:B6<=20))

Note that Sheet1 is lowercased by Excel. All my changes were made by
successive minimum editing of the original SUM formula.

Is there some way to make this kind of range work with SUMPRODUCT, short
of the obvious, namely breaking this into multiple subexpressions?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Multisheet range in SUMPRODUCT?

"Bob Phillips" wrote:
=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))


Thanks. That is helpful. However, that requires that Sheet3 exists, for
example. A range of the form Sheet1:Sheet4!B4:B6 works (with SUM) even if
there is no Sheet3.


----- original message -----

"Bob Phillips" wrote in message
...
Try

=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))

--

HTH

Bob

"Joe User" <joeu2004 wrote in message
...
When I write SUM(Sheet1:Sheet4!B4:B6), that works.

But if I change the function name to SUMPRODUCT, I get a #REF error.
Copied from the Formula Bar:

=SUMPRODUCT(Sheet1:Sheet4!B4:B6)

And if I use that form of range in a subexpression, I get a #NAME error.
Copied from the Formula Bar:

=SUMPRODUCT(--(sheet1:Sheet4!B4:B6<=20))

Note that Sheet1 is lowercased by Excel. All my changes were made by
successive minimum editing of the original SUM formula.

Is there some way to make this kind of range work with SUMPRODUCT, short
of the obvious, namely breaking this into multiple subexpressions?




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Multisheet range in SUMPRODUCT?

I wrote:
"Bob Phillips" wrote:
=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))

[....]
However, that requires that Sheet3 exists, for example.


I was able to leverage the idea to produce the following, albeit not as
robust as I would like:

=SUMPRODUCT(--(COUNTIF(INDIRECT({"sheet1","sheet2","sheet4"}&"!B 4:B6"),"<=20")))

However, I really want to get COUNTIF out of there. The formula I would
like is something like:

=SUMPRODUCT(--(INDIRECT({"sheet1","sheet2","sheet4"}&"!a4:a6")=A 5),
INDIRECT({"sheet1","sheet2","sheet4"}&"!b4:b6"))

Again, the obvious workaround is:

=SUMIF(Sheet1!A4:A6,A5,Sheet1!B4:B6)
+SUMIF(Sheet2!A4:A6,A5,Sheet2!B4:B6)
+SUMIF(Sheet4!A4:A6,A5,Sheet4!B4:B6)

And I guess that's not bad, if I must enumerate the worksheet names in the
INDIRECT expression.

I was hoping for something tidier and more extensible.


----- original message -----

"Joe User" <joeu2004 wrote in message
...
"Bob Phillips" wrote:
=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))


Thanks. That is helpful. However, that requires that Sheet3 exists, for
example. A range of the form Sheet1:Sheet4!B4:B6 works (with SUM) even if
there is no Sheet3.


----- original message -----

"Bob Phillips" wrote in message
...
Try

=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))

--

HTH

Bob

"Joe User" <joeu2004 wrote in message
...
When I write SUM(Sheet1:Sheet4!B4:B6), that works.

But if I change the function name to SUMPRODUCT, I get a #REF error.
Copied from the Formula Bar:

=SUMPRODUCT(Sheet1:Sheet4!B4:B6)

And if I use that form of range in a subexpression, I get a #NAME error.
Copied from the Formula Bar:

=SUMPRODUCT(--(sheet1:Sheet4!B4:B6<=20))

Note that Sheet1 is lowercased by Excel. All my changes were made by
successive minimum editing of the original SUM formula.

Is there some way to make this kind of range work with SUMPRODUCT, short
of the obvious, namely breaking this into multiple subexpressions?





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Multisheet range in SUMPRODUCT?

For counting frequencies of numbers in 3D ranges:

=INDEX(FREQUENCY(Sheet1:Sheet4!B4:B6,20),1)

=INDEX(FREQUENCY(Sheet1:Sheet4!B4:D6,20),1)

You can even use multiple area references (but not across sheets):

=INDEX(FREQUENCY((B4:B6,D4:D6,X1:X100),20),1)

--
Biff
Microsoft Excel MVP


"Bob Phillips" wrote in message
...
Try

=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))

--

HTH

Bob

"Joe User" <joeu2004 wrote in message
...
When I write SUM(Sheet1:Sheet4!B4:B6), that works.

But if I change the function name to SUMPRODUCT, I get a #REF error.
Copied from the Formula Bar:

=SUMPRODUCT(Sheet1:Sheet4!B4:B6)

And if I use that form of range in a subexpression, I get a #NAME error.
Copied from the Formula Bar:

=SUMPRODUCT(--(sheet1:Sheet4!B4:B6<=20))

Note that Sheet1 is lowercased by Excel. All my changes were made by
successive minimum editing of the original SUM formula.

Is there some way to make this kind of range work with SUMPRODUCT, short
of the obvious, namely breaking this into multiple subexpressions?







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Multisheet range in SUMPRODUCT?

that requires that Sheet3 exists

This doesn't:

=INDEX(FREQUENCY(Sheet1:Sheet4!B4:B6,20),1)

--
Biff
Microsoft Excel MVP


"Joe User" <joeu2004 wrote in message
...
I wrote:
"Bob Phillips" wrote:
=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))

[....]
However, that requires that Sheet3 exists, for example.


I was able to leverage the idea to produce the following, albeit not as
robust as I would like:

=SUMPRODUCT(--(COUNTIF(INDIRECT({"sheet1","sheet2","sheet4"}&"!B 4:B6"),"<=20")))

However, I really want to get COUNTIF out of there. The formula I would
like is something like:

=SUMPRODUCT(--(INDIRECT({"sheet1","sheet2","sheet4"}&"!a4:a6")=A 5),
INDIRECT({"sheet1","sheet2","sheet4"}&"!b4:b6"))

Again, the obvious workaround is:

=SUMIF(Sheet1!A4:A6,A5,Sheet1!B4:B6)
+SUMIF(Sheet2!A4:A6,A5,Sheet2!B4:B6)
+SUMIF(Sheet4!A4:A6,A5,Sheet4!B4:B6)

And I guess that's not bad, if I must enumerate the worksheet names in the
INDIRECT expression.

I was hoping for something tidier and more extensible.


----- original message -----

"Joe User" <joeu2004 wrote in message
...
"Bob Phillips" wrote:
=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))


Thanks. That is helpful. However, that requires that Sheet3 exists, for
example. A range of the form Sheet1:Sheet4!B4:B6 works (with SUM) even
if there is no Sheet3.


----- original message -----

"Bob Phillips" wrote in message
...
Try

=SUMPRODUCT(--(COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:4"))&"!B 4:B6"),"<=20")))

--

HTH

Bob

"Joe User" <joeu2004 wrote in message
...
When I write SUM(Sheet1:Sheet4!B4:B6), that works.

But if I change the function name to SUMPRODUCT, I get a #REF error.
Copied from the Formula Bar:

=SUMPRODUCT(Sheet1:Sheet4!B4:B6)

And if I use that form of range in a subexpression, I get a #NAME
error. Copied from the Formula Bar:

=SUMPRODUCT(--(sheet1:Sheet4!B4:B6<=20))

Note that Sheet1 is lowercased by Excel. All my changes were made by
successive minimum editing of the original SUM formula.

Is there some way to make this kind of range work with SUMPRODUCT,
short of the obvious, namely breaking this into multiple
subexpressions?






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
How do I delete the same row in a multisheet spreadsheet John M.Lees Excel Discussion (Misc queries) 2 October 15th 08 05:29 PM
Sumproduct with #N/A in range Deeds Excel Worksheet Functions 7 May 18th 06 06:01 PM
Select and Insert one sheet from a multisheet excel template Alex at Europlan Excel Discussion (Misc queries) 0 November 22nd 05 03:51 PM
Multisheet formula Todd Nelson Excel Discussion (Misc queries) 8 August 31st 05 07:29 PM
sumproduct in a range Tat Excel Worksheet Functions 9 June 12th 05 08:31 PM


All times are GMT +1. The time now is 10:35 PM.

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"