Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Probabilities


I have a number of probabilities and need to multiply them by numerous
other probabilities. Is there any way of multiplying cell A1 by cells
B1:b20 and summing the totals?

Thanks


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=563982

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Probabilities


Hello Phil2006,

Here is macro that should do what you need.


Code:
--------------------

Public Function SumScalarProduct(Scalar As Double, ProductArray As Range)
Dim ProdCell As Range
Dim Total

For Each ProdCell In ProductArray
Total = Total + (Scalar.Value * ProdCell.Value)
Next ProdCell

SumScalarProduct = Total
End Function

--------------------


Example of using the Macro:
Result = SumScalarProduct(Range("A1").Value, Range("B1:B20"))

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=563982

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Probabilities

=SUMPRODUCT(A1*B1:B10)

--
Regards,
Tom Ogilvy


"phil2006" wrote in
message ...

I have a number of probabilities and need to multiply them by numerous
other probabilities. Is there any way of multiplying cell A1 by cells
B1:b20 and summing the totals?

Thanks


--
phil2006
------------------------------------------------------------------------
phil2006's Profile:
http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=563982



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
Calculating probabilities Raul Sousa Excel Worksheet Functions 9 October 19th 09 06:44 PM
Calculating Probabilities Daisy Excel Worksheet Functions 3 March 3rd 08 08:01 PM
Question about use of Poisson probabilities Dora Smith Excel Worksheet Functions 1 February 4th 07 07:09 PM
Question about use of Poisson probabilities Dora Smith Excel Discussion (Misc queries) 4 February 4th 07 06:30 PM
Macro and probabilities MrKermit Excel Programming 2 March 31st 06 10:01 AM


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