PC Review


Reply
Thread Tools Rate Thread

dsum or sumproduct ?

 
 
Vass
Guest
Posts: n/a
 
      22nd May 2006
I have an SQL linked database
and am pulling info from this sheet
As I cannot add an additional column
I need a sum to do the following.

2 columns of figures, Qty and Cost price
I need to multiply each row to get total cost per line and return the grand
total

but this does not work as the mutliplication is totalling each column first
Ideally a third column in the SQL data would be the answer but I have no
idea how to add this
automatically as this data is refreshed every 5 mins

my attempt that does not work...

=((DSUM(maindata,"it_cost",$R$1:$S$2)/100)*(DSUM(maindata,"it_quan",$R$1:$S$2)/100))

R1:S2 = Date and criteria
it_cost and it_quan are in '000s hence the /100

Any ideas please ?

thanks

--
Vass





 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlndWVsIFphcGljbw==?=
Guest
Posts: n/a
 
      22nd May 2006
If you can use a pivot table, you can create a calculated field to do that
operation, and it will also calculate the grand totals for you.

Hope this helps,
Miguel.

"Vass" wrote:

> I have an SQL linked database
> and am pulling info from this sheet
> As I cannot add an additional column
> I need a sum to do the following.
>
> 2 columns of figures, Qty and Cost price
> I need to multiply each row to get total cost per line and return the grand
> total
>
> but this does not work as the mutliplication is totalling each column first
> Ideally a third column in the SQL data would be the answer but I have no
> idea how to add this
> automatically as this data is refreshed every 5 mins
>
> my attempt that does not work...
>
> =((DSUM(maindata,"it_cost",$R$1:$S$2)/100)*(DSUM(maindata,"it_quan",$R$1:$S$2)/100))
>
> R1:S2 = Date and criteria
> it_cost and it_quan are in '000s hence the /100
>
> Any ideas please ?
>
> thanks
>
> --
> Vass
>
>
>
>
>
>

 
Reply With Quote
 
C01d
Guest
Posts: n/a
 
      22nd May 2006

Use sumproduct as follows:

=SUMPRODUCT(A1:A19,B1:B19)

You will have to change the references accordingly. The first parameter
is an array of values representing the quantity while the second
parameter is an array of values representing the cost price.


--
C01d
------------------------------------------------------------------------
C01d's Profile: http://www.excelforum.com/member.php...o&userid=34422
View this thread: http://www.excelforum.com/showthread...hreadid=544346

 
Reply With Quote
 
Vass
Guest
Posts: n/a
 
      23rd May 2006
"C01d" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Use sumproduct as follows:
>
> =SUMPRODUCT(A1:A19,B1:B19)
>
> You will have to change the references accordingly. The first parameter
> is an array of values representing the quantity while the second
> parameter is an array of values representing the cost price.
>
>

OK I've tried this
data! being the second sheet holding the data
the first array is a condition that I only want customers = "RETAILAC" to be
included
data!E = quantity
data!W=cost price

=SUMPRODUCT(data!DA2A7199="RETAILAC",data!E2:E7199,data!W2:W7199)

but this returns a 0 value
any clues?
thanks
--
Vass


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DSUM vs. SUMPRODUCT =?Utf-8?B?bWF0ZWxvdA==?= Microsoft Excel Programming 2 1st May 2007 10:41 PM
DSUM or SUMPRODUCT? Vass Microsoft Excel Worksheet Functions 8 23rd May 2006 04:57 PM
DSUM or SUMPRODUCT? Nimit Mehta Microsoft Windows 2000 Networking 4 5th Jul 2004 05:54 AM
DSUM OR SUMPRODUCT? Nimit Mehta Microsoft Excel Worksheet Functions 3 5th Jul 2004 12:42 AM
dsum? or sumproduct? how? Nimit Mehta Microsoft Excel Worksheet Functions 0 1st Jul 2004 10:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:36 PM.