Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default more factors needed for an SP UDF

You will need to reverse the arguments, and dec places will be mandatory

Function mySP(dec As Long, ParamArray rng())
Dim sRanges As String
Dim i As Long

For i = LBound(rng) To UBound(rng)
sRanges = sRanges & rng(i).Address(, , , True) & "*"
Next i
mySP = Evaluate("=SumProduct(Round(" & _
Left(sRanges, Len(sRanges) - 1) & "," & dec & "))")
End Function

Use like

=mySP(2, A1:A100,B1:B100,C1:K100)

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"dribler2" wrote in message
...

I gain a UDF fed thru another post and this works for something like this

=mySP(A1:A100,C1:K100,2) [2 dimensional with one and a series of factors]
'------------------------------------------------
Function mySP(rng1 As Range, rng2 As Range, Optional dec As Long = 15)
mySP = Evaluate("=SumProduct(Round(" & rng1.Address(, , , True) & "*" &
rng2.Address(, , , True) & "," & dec & "))")
End Function
'-----------------------------------------------
Yet I need to know if it is still possible to move more farther with
something like this
=mySP(A1:A100,B1:B100,C1:K100,2) ---the above current UDF gaves me a
#VALUE!
for a 3 or more dimensional with a max. series of factors.

hope someone out there can understand to help me with this...

happy holidays,
dribler2



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
Look up with 2 factors AMC Excel Worksheet Functions 1 March 26th 09 04:55 AM
if senerios with 2 factors Tacklemom Excel Discussion (Misc queries) 1 March 20th 09 08:39 PM
ANOVA with two factors Ted M H Excel Worksheet Functions 2 July 26th 08 06:52 AM
Multiply one value by many factors ghofferbert Excel Worksheet Functions 2 October 13th 05 12:22 AM
Seasonal factors Dam Excel Programming 0 April 21st 05 11:46 AM


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