Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
njp njp is offline
external usenet poster
 
Posts: 7
Default SumProducts on a spreadsheet with a variable row dataset

I import data to a name range with MS query; the number of rows in the range
varies with each month import. I have multiple SumProduct formulas across
the columns.

I know I can use code to replace the bottom of the range reference in each
column's by finding the end of my named reference. However, I'd prefer to
use an offset or cell function instead of having to run a macro with each
query refresh.

Examples of what works
SUMPRODUCT((d5:d1152<"")/COUNTIF(d5:d1152,d5:d1152&""))


Examples of what doesn't
SUMPRODUCT(("D5:D"&C1<"")/COUNTIF("D5:D"&C1,"D5:D"&C1&""))
where the c1 contains =rows(MTL)-1
where MTL is my named range
--
Any assistance is appreciated,
Thanks
Nita J. Perez
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SumProducts on a spreadsheet with a variable row dataset

=SUMPRODUCT((INDIRECT("D5:D"&C1)<"")/COUNTIF(INDIRECT("D5:D"&C1),INDIRECT("
D5:D"&C1)&""))

--
Regards,
Tom Ogilvy

"NJP" wrote in message
...
I import data to a name range with MS query; the number of rows in the

range
varies with each month import. I have multiple SumProduct formulas

across
the columns.

I know I can use code to replace the bottom of the range reference in each
column's by finding the end of my named reference. However, I'd prefer to
use an offset or cell function instead of having to run a macro with each
query refresh.

Examples of what works
SUMPRODUCT((d5:d1152<"")/COUNTIF(d5:d1152,d5:d1152&""))


Examples of what doesn't
SUMPRODUCT(("D5:D"&C1<"")/COUNTIF("D5:D"&C1,"D5:D"&C1&""))
where the c1 contains =rows(MTL)-1
where MTL is my named range
--
Any assistance is appreciated,
Thanks
Nita J. Perez



  #3   Report Post  
Posted to microsoft.public.excel.programming
njp njp is offline
external usenet poster
 
Posts: 7
Default SumProducts on a spreadsheet with a variable row dataset

Tom,

Thanks - That works perfectly - I had tried indirect but missed the
parenthesis prior to the &"".
--
Nita J. Perez


"Tom Ogilvy" wrote:

=SUMPRODUCT((INDIRECT("D5:D"&C1)<"")/COUNTIF(INDIRECT("D5:D"&C1),INDIRECT("
D5:D"&C1)&""))

--
Regards,
Tom Ogilvy

"NJP" wrote in message
...
I import data to a name range with MS query; the number of rows in the

range
varies with each month import. I have multiple SumProduct formulas

across
the columns.

I know I can use code to replace the bottom of the range reference in each
column's by finding the end of my named reference. However, I'd prefer to
use an offset or cell function instead of having to run a macro with each
query refresh.

Examples of what works
SUMPRODUCT((d5:d1152<"")/COUNTIF(d5:d1152,d5:d1152&""))


Examples of what doesn't
SUMPRODUCT(("D5:D"&C1<"")/COUNTIF("D5:D"&C1,"D5:D"&C1&""))
where the c1 contains =rows(MTL)-1
where MTL is my named range
--
Any assistance is appreciated,
Thanks
Nita J. Perez




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SumProducts on a spreadsheet with a variable row dataset


Just wondering, have you considered having the sums at the top of the
page instead of the bottom, and then just collecting the sums below?
That way, the variable row issue isn't.


--
ljsmith


------------------------------------------------------------------------
ljsmith's Profile: http://www.excelforum.com/member.php...o&userid=30531
View this thread: http://www.excelforum.com/showthread...hreadid=547100

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 autodelete rows in a macro on a variable dataset? bimpnottin_noregard Excel Discussion (Misc queries) 6 January 29th 09 06:19 PM
Problems with SUMPRODUCTS John21 Excel Worksheet Functions 2 August 9th 06 05:53 PM
SUMPRODUCTS AJP Excel Worksheet Functions 4 July 14th 06 06:13 PM
Converting A Quarterly Dataset to Weekly Dataset Dan Thompson Excel Programming 5 November 25th 05 09:27 PM
How Can I paste the dataset on a spreadsheet Bhuvan Excel Programming 0 January 13th 05 10:09 PM


All times are GMT +1. The time now is 09:44 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"