Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Basic Probabilities UDF Function Help
Ive written a very basic UDF function to calculate 2 probabilities given several potential variables, but I keep receiving this error message and I am entirely stumped as to what to do. This is my first time using UDF, if someone could give me some pointers, I would greatly appreciate it. I have posted what I have written below.
Function PD(a As Variant, x As Variant, z As Variant) PD = [a(1.00-x)] + [z(1.00-a)] End Function Function PS(a As Variant, x As Variant, z As Variant) PS = (a * x) + [(1.00-a)*(1.00-z)] End Function But when I move to an excel sheet, and insert the respective equation, including telling the function which cells it should extract the variables from for the specific problem...I receive the error messagešValue!š Help? |
#2
|
|||
|
|||
Quote:
No? No one has any idea what I might be doing wrong? How disappointing. Ok. |
#3
|
|||
|
|||
Sorry your query has gone so long without a response.
I believe your issue is because of the square brackets you're using in the calculation. I don't think Excel likes these. The way to tell is to copy and paste your calculation straight into a cell in the workbook and see what the error message is - errors are suppressed when using a Function and all you get is "#NAME?" as a result if there is an error in the function. Try using round brackets (e.g.): PS = (a * x) + ((1 - a) * (1 - z)) Further to this, you also need to put in your multiplication signs in the PD function as Excel does not use the notation xy meaning x * y. PD = (a * (1 - x)) + (z * (1 - a)) I hope this helps. Last edited by tarquinious : March 3rd 11 at 05:15 PM |
#4
|
|||
|
|||
Quote:
THANKS FOR THE HELP, I APPRECIATE IT. UNFORTUNATELY IM GOING TO HAVE TO CONTINUE SEARCHING FOR MY ANSWER. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculating probabilities | Excel Worksheet Functions | |||
Calculating Probabilities | Excel Worksheet Functions | |||
Question about use of Poisson probabilities | Excel Worksheet Functions | |||
Question about use of Poisson probabilities | Excel Discussion (Misc queries) | |||
Probabilities, random numbers and dice throws | Excel Worksheet Functions |