Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Trouble with SUMPRODUCT


I need to add to the following SUMPRODUCT formula.

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=0),$F5:$CO5)

This formula basically sums every 3rd column in the range F5:CO5. I
need it to sum every 3rd column in the range, only based on the date in
cell CY2. The date range is F3:CO3. The date range is the 3 columns
merged together however.

So the sum would only be up to and including the date in CY2.

Thanks.

ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=557980

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Trouble with SUMPRODUCT

Hi!

So the sum would only be up to and including the date in CY2.


What do you mean by "up to and including" ?

That implies a date range (start date to end date) but you don't mention
what the start date is. You just mention cell CY2.

Here's the formula written to = CY2:

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=0),--(F3:CO3=CY2),$F5:$CO5)

If you have a date range:

CY1 = start date
CY2 = end date

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=0),--(F3:CO3=CY1),--(F3:CO3<=CY2),$F5:$CO5)

Biff

"edwardpestian"
wrote in message
news:edwardpestian.2aej8n_1151984403.7471@excelfor um-nospam.com...

I need to add to the following SUMPRODUCT formula.

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=0),$F5:$CO5)

This formula basically sums every 3rd column in the range F5:CO5. I
need it to sum every 3rd column in the range, only based on the date in
cell CY2. The date range is F3:CO3. The date range is the 3 columns
merged together however.

So the sum would only be up to and including the date in CY2.

Thanks.

ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile:
http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=557980



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Trouble with SUMPRODUCT


"The date range is F3:CO3. The date range is the 3 columns merged
together however."

Could you explain this a little better. Is the date made up of
F3&G3&H3 ?


--
duane


------------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...o&userid=11624
View this thread: http://www.excelforum.com/showthread...hreadid=557980

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Trouble with SUMPRODUCT


Yes, the date range is F3,G3,H3 merged together. The cell containing
the date - CY2 would for example contain 06/05/2006. So the formula
would sum every 3rd column; starting with the first column in the range
F5:CO5 who's date is less than or equal to the date 06/05/2006.

Biff, your formula worked except I had to add a less than sign. <=CY2.

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=0),--(F3:CO3=CY2),$F5:$CO5)

Thanks fellas.

ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=557980

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Trouble with SUMPRODUCT


Something strange is happening. When I move one column to the right.
In order to sum the second column in the range, its summing the entire
range instead of the dates up to and including the date in cell CY2.

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=1),--($F$3:$CO$3<=$CY$2),$F5:$CO5)

Thanks again.

ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=557980



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Trouble with SUMPRODUCT

"edwardpestian"
wrote in message
news:edwardpestian.2aemhd_1151988602.9131@excelfor um-nospam.com...

Something strange is happening. When I move one column to the right.
In order to sum the second column in the range, its summing the entire
range instead of the dates up to and including the date in cell CY2.

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=1),--($F$3:$CO$3<=$CY$2),$F5:$CO5)


That's because of your merged cells. Moving one column to the right (by
changing the MOD to = 1), now the formula is referring to G5:CO5 and G3:CO3.
G3 and all cells in row 3 within the range that meet the MOD condition are
empty and those cells evaluate to 0 and 0 <= CY2. Even though G3 is merged
with F3 and H3 it can still be referenced as a separate cell. Only the top
left cell in a merged group contains the value.

You can try this:

=SUMPRODUCT(--(MOD(COLUMN($F5:$CO5),3)=1),--(OFFSET(F3:CO3,,-1)<=CY2),$F5:$CO5)

Personally, I would unmerge the cells and put dates in all cells of the date
row. Merged cells usually do nothing but cause problems!

Biff


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Trouble with SUMPRODUCT


Thanks Biff,

Understanding that the top left hand cell contains the merged data
clarifies why the same formula will not work. As you indicated in your
suggestion, the best way would be to unmerge the cells and put the date
in all three cells. I simple changed the font color to match the
background color on the left and right cell and it looks as it did.

ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=557980

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default Trouble with SUMPRODUCT

You made the right decision. Thanks for the feedback!

Biff

"edwardpestian"
wrote in message
news:edwardpestian.2agizz_1152077403.3754@excelfor um-nospam.com...

Thanks Biff,

Understanding that the top left hand cell contains the merged data
clarifies why the same formula will not work. As you indicated in your
suggestion, the best way would be to unmerge the cells and put the date
in all three cells. I simple changed the font color to match the
background color on the left and right cell and it looks as it did.

ep


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile:
http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=557980



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
Adding "OR" to a Sumproduct Formula Duke Carey Excel Worksheet Functions 0 March 21st 06 06:41 PM
help please - trouble with sumproduct function Jennie Excel Worksheet Functions 2 June 17th 05 09:40 PM
Can I reference =, <, or > sign in SUMPRODUCT BobT Excel Discussion (Misc queries) 7 February 16th 05 01:58 PM
Sumproduct function not working Scott Summerlin Excel Worksheet Functions 12 December 4th 04 05:15 AM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


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