Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
syrac
 
Posts: n/a
Default SumProduct Question

This what I am looking to do. My data source is a SQL database.

I have a query with three fields. I want to get counts on three criteria, I
have the two working find, now need the date.
=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 = "EMAIL"))
This works fine.

The other field from Sheet1 that I want to check is a date field in the
following format.

6/15/2005 9:13


I want my report to be monthly, so I would like it check for $A6 and EMAIL
above and in my example, month of June data only.
Something like Month(data from Sheet1) = 6. I really don't want to use a
helper column if not necessary.

=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 = "EMAIL")
* (Sheet1$C$2:$C$1000 = MONTH( not sure after this)

Thanks



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

=SUMPRODUCT(--(Sheet1!$A$2:$A$10000 = $A6),--(Sheet1!$D$2:$D$10000 =
"EMAIL"),--(TEXT(Sheet1$C$2:$C$1000,"mmm")="Jun"))


--
HTH

Bob Phillips

"syrac" wrote in message
...
This what I am looking to do. My data source is a SQL database.

I have a query with three fields. I want to get counts on three criteria,

I
have the two working find, now need the date.
=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 =

"EMAIL"))
This works fine.

The other field from Sheet1 that I want to check is a date field in the
following format.

6/15/2005 9:13


I want my report to be monthly, so I would like it check for $A6 and EMAIL
above and in my example, month of June data only.
Something like Month(data from Sheet1) = 6. I really don't want to use a
helper column if not necessary.

=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 =

"EMAIL")
* (Sheet1$C$2:$C$1000 = MONTH( not sure after this)

Thanks





  #3   Report Post  
syrac
 
Posts: n/a
Default

Hi Bob,

I tried your formula and it is giving me an error (that was the message two)



"Bob Phillips" wrote in message
...
=SUMPRODUCT(--(Sheet1!$A$2:$A$10000 = $A6),--(Sheet1!$D$2:$D$10000 =
"EMAIL"),--(TEXT(Sheet1$C$2:$C$1000,"mmm")="Jun"))


--
HTH

Bob Phillips

"syrac" wrote in message
...
This what I am looking to do. My data source is a SQL database.

I have a query with three fields. I want to get counts on three

criteria,
I
have the two working find, now need the date.
=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 =

"EMAIL"))
This works fine.

The other field from Sheet1 that I want to check is a date field in the
following format.

6/15/2005 9:13


I want my report to be monthly, so I would like it check for $A6 and

EMAIL
above and in my example, month of June data only.
Something like Month(data from Sheet1) = 6. I really don't want to use

a
helper column if not necessary.

=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 =

"EMAIL")
* (Sheet1$C$2:$C$1000 = MONTH( not sure after this)

Thanks







  #4   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Change $C$1000 to $C$10000

all arrays must be the same size.

In article ,
"syrac" wrote:

Hi Bob,

I tried your formula and it is giving me an error (that was the message two)



"Bob Phillips" wrote in message
...
=SUMPRODUCT(--(Sheet1!$A$2:$A$10000 = $A6),--(Sheet1!$D$2:$D$10000 =
"EMAIL"),--(TEXT(Sheet1$C$2:$C$1000,"mmm")="Jun"))

  #5   Report Post  
syrac
 
Posts: n/a
Default

Fixed that already, still getting the formula error


"JE McGimpsey" wrote in message
...
Change $C$1000 to $C$10000

all arrays must be the same size.

In article ,
"syrac" wrote:

Hi Bob,

I tried your formula and it is giving me an error (that was the message

two)



"Bob Phillips" wrote in message
...
=SUMPRODUCT(--(Sheet1!$A$2:$A$10000 = $A6),--(Sheet1!$D$2:$D$10000 =
"EMAIL"),--(TEXT(Sheet1$C$2:$C$1000,"mmm")="Jun"))





  #6   Report Post  
JE McGimpsey
 
Posts: n/a
Default

In article ,
"syrac" wrote:

Fixed that already, still getting the formula error


Would have been helpful to state that...

Did you also fix the


Sheet1$C$2

by changing it to

Sheet1!$C$2

??

If so, that formula works for me.
  #7   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

syrac wrote:
This what I am looking to do. My data source is a SQL database.

I have a query with three fields. I want to get counts on three criteria, I
have the two working find, now need the date.
=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 = "EMAIL"))
This works fine.

The other field from Sheet1 that I want to check is a date field in the
following format.

6/15/2005 9:13


I want my report to be monthly, so I would like it check for $A6 and EMAIL
above and in my example, month of June data only.
Something like Month(data from Sheet1) = 6. I really don't want to use a
helper column if not necessary.

=SUMPRODUCT((Sheet1!$A$2:$A$10000 = $A6) * (Sheet1!$D$2:$D$10000 = "EMAIL")
* (Sheet1$C$2:$C$1000 = MONTH( not sure after this)

Thanks




=SUMPRODUCT((Sheet1!$A$2:$A$10000=$A6)+0,(Sheet1!$ D$2:$D$10000="EMAIL")+0,(INT(Sheet1!$C$2:$C$10000-DAY(Sheet1!$C$2:$C$10000)+1)=$B6)+0)

where B6 houses a month/year of interest, set up as a first day date,
e.g., 6/1/2005 for June 2005.
--

[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.
  #8   Report Post  
 
Posts: n/a
Default


syrac wrote:
This what I am looking to do. My data source is a SQL database.

I have a query with three fields. I want to get counts on three criteria, I
have the two working find, now need the date.


Didn't you say you were using SQL?

SELECT SUM(some_column) AS return_vale FROM MyTable WHERE other_colmn =
'EMAIL' AND another_column = <<value from A6 here

SELECT SUM(some_column) AS return_vale FROM MyTable WHERE other_colmn =
'EMAIL' AND MONTH(date_colmn) = MONTH(CURRENT_TIMESTAMP)

You could create a view on the database server to group the data. You
could create a proc on the server to pass the cell value. You could
create a join on the server between your table and your worksheet. You
could write queries in Excel using just the base tables in the
database. Make the database do the work so you don't have to.

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
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 question taxmom Excel Worksheet Functions 3 April 18th 05 07:01 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:34 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"