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

i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:
=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks


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

Why not put the other date in A5 and test against that?

--

HTH

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


"Dominique Feteau" wrote in message
...
i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:

=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks




  #3   Report Post  
KL
 
Posts: n/a
Default

Hi Dominique,

How about this:

=SUMPRODUCT(--(TEXT(Data!E$2:E$3850,"mmyy")=TEXT(A4,"mmyy")),--(Data!F$2:F$3850=B$3))

Regard,
KL



"Dominique Feteau" wrote in message
...
i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:
=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks




  #4   Report Post  
bj
 
Posts: n/a
Default

I don't see anything wrong with the formula. what is the inaccuracy?

"Dominique Feteau" wrote:

i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:
=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks



  #5   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

Are you trying to count for November 2004? If so, try:

A4: 1-Nov-04

which is the first day date of the month/year of interest.

Now invoke:

=SUMPRODUCT(--(Data!E$2:E$3850-DAY(Data!E$2:E$3850)+1=A4),--(Data!F$2:F$3850=B$3))

Dominique Feteau wrote:
i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:
=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks



--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.


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

A collegue of mine figured it out. The reason it was inaccurate was because
I was telling it start at this date and subtract this many days to count
between. For some odd reason, a few values weren't counted. (e.g. there
were 55 "POE-Cite"'s in december, but it only counted 54. So instead of
having the formula calculate the start and end date on its own, I gave it
specific dates. Here's the solution I got:

=SUMPRODUCT(--(E2:E301838322),--(E2:E3018<38352),--(F2:F3018="POE-Cite"))

works like a charm.

thanx for the help.
Niq

"bj" wrote in message
...
I don't see anything wrong with the formula. what is the inaccuracy?

"Dominique Feteau" wrote:

i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:

=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks





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

More intuitive to use

=SUMPRODUCT(--(E2:E3018--"2004-12-01"),--(E2:E3018<--"2004-12-31"),--(F2:F3
018="POE-Cite"))


--

HTH

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


"Dominique Feteau" wrote in message
...
A collegue of mine figured it out. The reason it was inaccurate was

because
I was telling it start at this date and subtract this many days to count
between. For some odd reason, a few values weren't counted. (e.g. there
were 55 "POE-Cite"'s in december, but it only counted 54. So instead of
having the formula calculate the start and end date on its own, I gave it
specific dates. Here's the solution I got:

=SUMPRODUCT(--(E2:E301838322),--(E2:E3018<38352),--(F2:F3018="POE-Cite"))

works like a charm.

thanx for the help.
Niq

"bj" wrote in message
...
I don't see anything wrong with the formula. what is the inaccuracy?

"Dominique Feteau" wrote:

i have a table that has column of dates and a column of names of

forms.

heres the sumproduct function i'm using:


=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30",

is
there a way to use a specific range? i thought using an "AND"

statement
would work, but it isnt.

thanks







  #8   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

What is wrong with:

=SUMPRODUCT(--(Data!E$2:E$3850-DAY(Data!E$2:E$3850)+1=A4),--(Data!F$2:F$3850=B$3))

where A4 houses: 1-Dec-04 and B3 POE-Cite?

Note that A4 contains the first day date of the month/year of interest.

Dominique Feteau wrote:
A collegue of mine figured it out. The reason it was inaccurate was because
I was telling it start at this date and subtract this many days to count
between. For some odd reason, a few values weren't counted. (e.g. there
were 55 "POE-Cite"'s in december, but it only counted 54. So instead of
having the formula calculate the start and end date on its own, I gave it
specific dates. Here's the solution I got:

=SUMPRODUCT(--(E2:E301838322),--(E2:E3018<38352),--(F2:F3018="POE-Cite"))

works like a charm.

thanx for the help.
Niq

"bj" wrote in message
...

I don't see anything wrong with the formula. what is the inaccuracy?

"Dominique Feteau" wrote:


i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:


=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F

$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks







--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.
  #9   Report Post  
KL
 
Posts: n/a
Default

Using Aladin's idea, I think you can make the formula slightly more
flexible:

=SUMPRODUCT(--(Data!$E$2:$E$3850-DAY(Data!$E$2:$E$3850)=$D$1-DAY($D$1)),--(Data!$F$2:$F$3850=$D$2))

now you can put any date into [A4]

The performance difference between the original formula and the above
version of it seems to be negligeble if copying over 800 to 5000 cells, but
you probably wouldn't want to copy it to many cells anyway :-).

Regards,
KL


"Dominique Feteau" wrote in message
...
i have a table that has column of dates and a column of names of forms.

heres the sumproduct function i'm using:
=SUMPRODUCT(--(Data!E$2:E$3850=A4-30),--(Data!E$2:E$3850<=A4),--(Data!F$2:F
$3850=B$3))

A4 = 12/31/04 (Date)
B3 = "POE-Cite" (Form)

only problem is that its not very accurate. instead of using "A4-30", is
there a way to use a specific range? i thought using an "AND" statement
would work, but it isnt.

thanks




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
SumProduct Question syrac Excel Worksheet Functions 7 June 17th 05 11:16 AM
Question about sumproduct Jason Excel Discussion (Misc queries) 1 April 21st 05 05:44 PM
Question about sumproduct bj Excel Discussion (Misc queries) 0 April 21st 05 05:40 PM
SUMPRODUCT with date range question Rob V Excel Discussion (Misc queries) 1 January 31st 05 03:55 PM
SUMPRODUCT question Daniel Bonallack Excel Worksheet Functions 4 November 29th 04 02:03 PM


All times are GMT +1. The time now is 07:09 PM.

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"