LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default any UDF for sum or rounded product

Function mySP(rng1 As Range, rng2 As Range, Optional dec As Long = 2)
mySP = Application.Caller.Parent.Evaluate("SUMPRODUCT(ROU ND(A1:A3*B1:B3," &
dec & "))")
End Function


=mySP(A1:A3,B1:B3,1)

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"dribler2" wrote in message
...
I have two columns (e.g. a1:a100 and b1:b100) filled numeric values and i
need the sumproduct of the two columns of data, considering that it will
only
read or sum the each result up to 2 decimal places only ....

can anyone help me out with this with a single UDformula.

e.g.

[col A] [col B] [rounded product A*B in 2 decimals]

[$ 1.233 ] [ 33.222 ] [ $ 40.96 ]
[$ 0.245 ] [ 11.111 ] [ $ 2.72 ]
[$ 0.122 ] [ -3.215 ] [ $ -0.39 ]

from the above sample the sum of the product (2 decimals) = $43.29

i hope that the UDF, if available, can be instructed for any user desired
number of decimals.

can anyone help me out with this.

any of your suggestion is requested.



 
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
rounded # to correct # Wagnerk Excel Worksheet Functions 4 April 15th 10 08:29 PM
add rounded numbers using the rounded value Ruth Excel Discussion (Misc queries) 2 February 8th 10 07:59 PM
Product Code and Product Description setup Nastyashman Excel Worksheet Functions 4 July 6th 09 05:48 PM
I need a product key for my Trail product, 2007 Microsoft Office s sltchsyi Setting up and Configuration of Excel 0 May 4th 09 01:32 AM
Vlookup code product and to copy commentary with photo of the product in vba [email protected] Excel Programming 0 October 2nd 06 03:54 AM


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

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"