Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2003 not recognising customer fucntion 1

Status
Not open for further replies.

SmithyJD

IS-IT--Management
Sep 23, 2004
52
GB
I have added a customer fuction to my personal.xls as coded below

Function Discount(quantity, price)
'Calculates a discount for orders greater than 100 units
If quantity >= 100 Then 'If more than 100 units
Discount = quantity * price * 0.1 'Calculate a 10% discount
Else
Discount = 0 'Otherwise, no discount
End If
Discount = Application.Round(Discount, 2) 'Round to 2 places
End Function


however when I try and use it in a spreadsheet eg =discount(C9,D9) it comes up with a #name? error in the cell as if the function cannot be found any ideas where I am going wrong?

Jd
 



hi,

If you use the Insert Function feature, a window appears.

In the or select a category: drop down select user defined

Scroll down to select your function. Note the reference in the formula bar after you make the selection and argument assignments.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks Skip, Thats where I was going wrong.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top