1
Answer

Excel #NAME? error

Ask a question

This may seem easy but I've been all over and cannot find an answer.  I'm hoping that somone can help.  I used a User Defined Function like the one below and get the #NAME? error in the cell.  Loaded the Analysis ToolPak - VBA and still no help.  Spelling in formula is correct and the function come up with intellisense.  any suggestions?

Formula in cell is =Commission(D22) where the value of D22 might be .47

 

Function Commission(GPM As Double)

Select Case GPM

      Case Is > 0.5999

        Commission = 0.15

      Case Is > 0.5799

        Commission = 0.14

    Case Is > 0.5599

       Commission = 0.13

    Case Is > 0.5399

        Commission = 0.12

    Case Is > 0.5199

        Commission = 0.11

    Case Is > 0.4999

        Commission = 0.1

    Case Is > 0.4799

        Commission = 0.09

    Case Is > 0.4399

        Commission = 0.08

    Case Is > 0.3999

        Commission = 0.07

    Case Is > 0.3599

        Commission = 0.06

    Case Is > 0.3199

        Commission = 0.05

    Case Is > 0.2799

        Commission = 0.04

    Case Is > 0.2399

        Commission = 0.03

    Case Is > 0.1999

        Commission = 0.02

    Case Is > 0.599

        Commission = 0.01

    Case Else

        Commission = 0

End Select

 

End Function
 


Answers (1)