Announcement

Collapse
No announcement yet.

Percent Error function

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Percent Error function

    I was wondering if excel has a bult-in function that calculates the percent error between two numbers. I wrote my own function to do it, but I was curious to know if there is an existing one. Heres the code to the function.
    Code:
    Public Function percentdiff(Expected As Single, Actual As Single) As Single
    
    Dim diff As Single
    
    diff = Abs((Expected - Actual) / Expected) * 100
    percentdiff = diff
    
    
    End Function
    Thanks.

  • #2
    Re: Percent Error function

    I don't know of one. Thank you for putting this one up. I may never need it, but a simple calculation like this is ideal to show just how to code a user-defined function, and if I ever need to write one, I'll come and look at yours! Cheers.
    .

    Comment

    Working...
    X