Ozgrid Excel Help & Best Practices Forums

Excel Training / Excel Dashboards Reports

Results 1 to 2 of 2

Thread: Percent Error function

  1. #1
    Join Date
    2nd June 2006

    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.
    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 

    Excel Video Tutorials / Excel Dashboards Reports

  2. #2
    Join Date
    7th December 2005
    Hampshire, England

    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.

    Excel Video Tutorials / Excel Dashboards Reports

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Add X Percent To Value
    By ron wyatt in forum EXCEL HELP
    Replies: 2
    Last Post: September 21st, 2007, 19:01
  2. Replies: 1
    Last Post: May 15th, 2007, 07:05
  3. Replies: 6
    Last Post: April 27th, 2007, 15:47
  4. Percent example?
    By zenfor in forum EXCEL HELP
    Replies: 6
    Last Post: June 16th, 2005, 04:36
  5. Percent Formula
    By JKDCOMM in forum EXCEL HELP
    Replies: 2
    Last Post: June 7th, 2005, 08:40


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts