Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
AJMorgan591
 
Posts: n/a
Default Surely a simple solution exists


Hi all,
I need a formula to do the following (I'm sure there is a very simple
solution but it is just eluding me right now)...

Let's say for example:
I have a list of numeric values in A1:A10.
I have a list of prices in B1:B10.

In cell C1, I want the sum of (A1:A10 multiplied by B1:B10) for each
value in A1:A10 greater than zero.

To make that a little clearer, I want to iterate down column A, looking
each numeric value. If (and only if) the value is greater than zero, I
want that value multiplied by it's neighbour in column B. I then want
the sum of these products in C1.

I do *not* want to create a new column filled with the products of
column A multiplied by column B (for each value in column A greater
than zero) and then sum this column. I want to knob two birds with one
johnny do the whole lot in one formula. Is this possible (preferrably
without VBA)??

Thanks very much in advance :)


--
AJMorgan591
------------------------------------------------------------------------
AJMorgan591's Profile: http://www.excelforum.com/member.php...o&userid=27774
View this thread: http://www.excelforum.com/showthread...hreadid=473661

  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

=SUMPRODUCT(A1:A10,B1:B10)

Biff

"AJMorgan591"
wrote in message
...

Hi all,
I need a formula to do the following (I'm sure there is a very simple
solution but it is just eluding me right now)...

Let's say for example:
I have a list of numeric values in A1:A10.
I have a list of prices in B1:B10.

In cell C1, I want the sum of (A1:A10 multiplied by B1:B10) for each
value in A1:A10 greater than zero.

To make that a little clearer, I want to iterate down column A, looking
each numeric value. If (and only if) the value is greater than zero, I
want that value multiplied by it's neighbour in column B. I then want
the sum of these products in C1.

I do *not* want to create a new column filled with the products of
column A multiplied by column B (for each value in column A greater
than zero) and then sum this column. I want to knob two birds with one
johnny do the whole lot in one formula. Is this possible (preferrably
without VBA)??

Thanks very much in advance :)


--
AJMorgan591
------------------------------------------------------------------------
AJMorgan591's Profile:
http://www.excelforum.com/member.php...o&userid=27774
View this thread: http://www.excelforum.com/showthread...hreadid=473661



  #3   Report Post  
Max
 
Posts: n/a
Default

In cell C1, I want the sum of (A1:A10 multiplied by B1:B10)
for each value in A1:A10 greater than zero.


Maybe in C1: =SUMPRODUCT(--(A1:A100),(A1:A10)*(B1:B10))
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #4   Report Post  
Biff
 
Posts: n/a
Default

What am I missing here?

A1 = 0
B1 = 10

A1*B1 = 0

Does not effect the final sum.

Biff

"Max" wrote in message
...
In cell C1, I want the sum of (A1:A10 multiplied by B1:B10)
for each value in A1:A10 greater than zero.


Maybe in C1: =SUMPRODUCT(--(A1:A100),(A1:A10)*(B1:B10))
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--




  #5   Report Post  
Max
 
Posts: n/a
Default

"Biff" wrote
What am I missing here?


My interp was simply that there could be negative values within A1:A10
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


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
Show trial solution lui78 Excel Worksheet Functions 1 November 16th 05 10:35 AM
Help with what should be a simple formula B Millar via OfficeKB.com Excel Worksheet Functions 2 June 16th 05 04:18 PM
Generating excel combinations mark4006 Excel Discussion (Misc queries) 2 March 6th 05 04:40 PM
Simple But Stumped Brian Keanie Excel Discussion (Misc queries) 3 February 5th 05 02:56 AM
Ploting dates against a calendar and not as a simple events Barb Reinhardt Charts and Charting in Excel 2 January 22nd 05 02:41 AM


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