Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dominique Feteau
 
Posts: n/a
Default sumproduct between dates

I have a sheet that has nothing but data. Columns a Date, Employee, Form,
Number

On another sheet, i want to add the total of "numbers" per "form" per week
from the "date"

now the date on the first sheet is daily. on the second sheet its "week
ending".

how do i set up the formula to add up only those for a certain week?


  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

If you have the week ending date all you need to do is
subtract 6 to get the week starting date.

On your sheet2 assume you have the week ending date in
cell A2. The formula would be something like this:

Assume:

Sheet1 Col A = dates
Sheet1 Col C = form
Sheet1 Col D = number


=SUMPRODUCT(--(Sheet1!A2:A20=A2-6),--(Sheet1!A2:A20<=A2),-
-(Sheet1!C2:C20="whatever"),D2:D20)

Biff

-----Original Message-----
I have a sheet that has nothing but data. Columns a

Date, Employee, Form,
Number

On another sheet, i want to add the total of "numbers"

per "form" per week
from the "date"

now the date on the first sheet is daily. on the second

sheet its "week
ending".

how do i set up the formula to add up only those for a

certain week?


.

  #3   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

An example.
Sheet1: Data (in same order as in your message) in range A2:D100
Sheet2:
A2=LastDateOfWeek (a date!)
B2=Form
The formula will be
=SUMPRODUCT(--(Sheet1!$A$2:$A$100<=A2),--(Sheet1!$A$2:$A$100<(A2-7)),--(Shee
t1!$C$2:$C$100=B2),Sheet1!$D$2:$D$100)

Arvi Laanemets


"Dominique Feteau" wrote in message
...
I have a sheet that has nothing but data. Columns a Date, Employee,

Form,
Number

On another sheet, i want to add the total of "numbers" per "form" per week
from the "date"

now the date on the first sheet is daily. on the second sheet its "week
ending".

how do i set up the formula to add up only those for a certain week?




  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Oops! A typo! The right formula is here

=SUMPRODUCT(--(Sheet1!$A$2:$A$100<=A2),--(Sheet1!$A$2:$A$100(A2-7)),--(Shee
t1!$C$2:$C$100=B2),Sheet1!$D$2:$D$100)


Arvi Laanemets


  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

As an alternative, if you could use

=SUMPRODUCT(--(WEEKNUM(Sheet1!$A$2:$A$100)=WEEKNUM(A2)),Sheet1!$ D$2:$D$100)


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dominique Feteau" wrote in message
...
I have a sheet that has nothing but data. Columns a Date, Employee,

Form,
Number

On another sheet, i want to add the total of "numbers" per "form" per week
from the "date"

now the date on the first sheet is daily. on the second sheet its "week
ending".

how do i set up the formula to add up only those for a certain week?






  #6   Report Post  
Don
 
Posts: n/a
Default

Hi Bob,
I like your formula but I cannot get it to work. Does it work for you?

I get #value

"Bob Phillips" wrote in message
...
As an alternative, if you could use

=SUMPRODUCT(--(WEEKNUM(Sheet1!$A$2:$A$100)=WEEKNUM(A2)),Sheet1!$ D$2:$D$100)


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dominique Feteau" wrote in message
...
I have a sheet that has nothing but data. Columns a Date, Employee,

Form,
Number

On another sheet, i want to add the total of "numbers" per "form" per
week
from the "date"

now the date on the first sheet is daily. on the second sheet its "week
ending".

how do i set up the formula to add up only those for a certain week?






  #7   Report Post  
Daniel.M
 
Posts: n/a
Default

Hi,

It can't work.

WEEKNUM() can't return an Array : that's cleary a Microsoft's implementation
weakness.

But if you can live with a formula that's only compatible with a 1900 calendar:

=SUMPRODUCT((FLOOR(Sheet1!$A$2:$A$100,7)=FLOOR(A2, 7))* Sheet1!$D$2:$D$100)

If you want a (longer) 1900/1904 calendar compatible formula, advise here!

Regards,

Daniel M.


"Don" wrote in message
...
Hi Bob,
I like your formula but I cannot get it to work. Does it work for you?

I get #value

"Bob Phillips" wrote in message
...
As an alternative, if you could use

=SUMPRODUCT(--(WEEKNUM(Sheet1!$A$2:$A$100)=WEEKNUM(A2)),Sheet1!$ D$2:$D$100)


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dominique Feteau" wrote in message
...
I have a sheet that has nothing but data. Columns a Date, Employee,

Form,
Number

On another sheet, i want to add the total of "numbers" per "form" per
week
from the "date"

now the date on the first sheet is daily. on the second sheet its "week
ending".

how do i set up the formula to add up only those for a certain week?








  #8   Report Post  
Bob Phillips
 
Posts: n/a
Default

Sorry about that, too good to be true. As Daniel says, the fact that it
doesn't work is a flaw in the implementation of the WEENIE function.

Daniel's formula works, but whilst it has a more immediate test that Arvi
and Biff's solutions, it is not as intuitive. I tried (and failed :-)) to
provide a more elegant solution, which didn't work, so I would go with your
first solutions.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Don" wrote in message
...
Hi Bob,
I like your formula but I cannot get it to work. Does it work for you?

I get #value

"Bob Phillips" wrote in message
...
As an alternative, if you could use


=SUMPRODUCT(--(WEEKNUM(Sheet1!$A$2:$A$100)=WEEKNUM(A2)),Sheet1!$ D$2:$D$100)


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dominique Feteau" wrote in message
...
I have a sheet that has nothing but data. Columns a Date, Employee,

Form,
Number

On another sheet, i want to add the total of "numbers" per "form" per
week
from the "date"

now the date on the first sheet is daily. on the second sheet its

"week
ending".

how do i set up the formula to add up only those for a certain week?








  #9   Report Post  
Dominique Feteau
 
Posts: n/a
Default

Thanks guys, but I figured out a better way using pivottables. It wont
update automatically but i know of a way to do that.

lata
niq

"Dominique Feteau" wrote in message
...
I have a sheet that has nothing but data. Columns a Date, Employee,
Form, Number

On another sheet, i want to add the total of "numbers" per "form" per week
from the "date"

now the date on the first sheet is daily. on the second sheet its "week
ending".

how do i set up the formula to add up only those for a certain week?



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
Formating Dates for production schedule dpl7579 Excel Discussion (Misc queries) 1 January 11th 05 08:43 PM
due dates Niki New Users to Excel 4 January 10th 05 04:11 PM
I get wrong dates when i paste from a different sheet into a new s mmollat Excel Discussion (Misc queries) 2 January 6th 05 07:35 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 12:15 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"