Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Sumproduct with a variable range

I am stumped on this one. I need to calculate the sumproduct on two columns
from data in a different workbook but the range will vary according to start
and end dates the user will choose.

Example: If I enter 5/22/08 as the start date and 6/2/08 as the end date, I
need a formula to calculate that the arrays for the sumproduct will be G150:
G161 and H150:H161, but if the start date is 5/25/08 with the same end date
the arrays would be G153:G161 and H153:H161.

Can anyone offer any suggestions? Thank you for your time.

Ray

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 171
Default Sumproduct with a variable range

You could create your arrays using the longer form of the offset function.
If your start and end dates are in B2 and B3, the first array would be
something like offset($g$1,($b$2+6-date(2007,12,31)),0,$b$3-$b$2+1,1). I'd
be inclined to define names for the first row and number of rows that you
want to include, so that you'd wind up with an array definition like
offset($G$1,first_row-1,0,row_count,1)

"rhowell100103" wrote:

I am stumped on this one. I need to calculate the sumproduct on two columns
from data in a different workbook but the range will vary according to start
and end dates the user will choose.

Example: If I enter 5/22/08 as the start date and 6/2/08 as the end date, I
need a formula to calculate that the arrays for the sumproduct will be G150:
G161 and H150:H161, but if the start date is 5/25/08 with the same end date
the arrays would be G153:G161 and H153:H161.

Can anyone offer any suggestions? Thank you for your time.

Ray


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Sumproduct with a variable range

Thank you. I will give it a try and let you know how I made out.

bpeltzer wrote:
You could create your arrays using the longer form of the offset function.
If your start and end dates are in B2 and B3, the first array would be
something like offset($g$1,($b$2+6-date(2007,12,31)),0,$b$3-$b$2+1,1). I'd
be inclined to define names for the first row and number of rows that you
want to include, so that you'd wind up with an array definition like
offset($G$1,first_row-1,0,row_count,1)

I am stumped on this one. I need to calculate the sumproduct on two columns
from data in a different workbook but the range will vary according to start

[quoted text clipped - 8 lines]

Ray


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Sumproduct with a variable range

bpeltzer,

That worked beautifully. The answer is so simple yet it eluded me. I would
never have thought of incorporating the height and width options of OFFSET as
I don't think I have ever had cause to use them before. Thank you so much
for taking your time to help me. I greatly appreciate it.

bpeltzer wrote:
You could create your arrays using the longer form of the offset function.
If your start and end dates are in B2 and B3, the first array would be
something like offset($g$1,($b$2+6-date(2007,12,31)),0,$b$3-$b$2+1,1). I'd
be inclined to define names for the first row and number of rows that you
want to include, so that you'd wind up with an array definition like
offset($G$1,first_row-1,0,row_count,1)

I am stumped on this one. I need to calculate the sumproduct on two columns
from data in a different workbook but the range will vary according to start

[quoted text clipped - 8 lines]

Ray


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/SUMPRODUCT Criteria are Variable Sized Thomas [PBD] Excel Discussion (Misc queries) 3 May 19th 08 05:19 PM
sumproduct with one variable criteria? Cif Excel Worksheet Functions 11 September 25th 06 07:49 PM
SUMPRODUCT WITH A VARIABLE CRITERIA? Cif Excel Worksheet Functions 2 September 25th 06 02:29 PM
variable range John New Users to Excel 2 July 21st 06 03:42 PM
sumproduct - reading a variable value redneck joe Excel Discussion (Misc queries) 3 May 24th 06 08:02 PM


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