Consulting

Results 1 to 3 of 3

Thread: Array Average not working right..

  1. #1

    Array Average not working right..

    I have this problem and I don't know why. I have enclosed a copy of my spreadsheet. When I run the MACRO "MAIN" from the Test Run 1 Sheet, it plots everything just fine, but the averages are wrong. It shows a average of 15.00 when it should be 14.63 for 99% of the cells... Any ideas on why this is happening??

    Also, Is there a way that I can plot on the same table or another table that shows how many data points for the given field?? IE. 20 data points at map 50 rpm 800..

    Thanks
    Chad

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi Chad,
    this is just me being stupid..!
    I declared the arrays as arrays of integers
    You need to change them to singles to accept floating point numbers
    In Sub AnalyzeData, change:

    Dim arrVals(1 To 19, 1 To 20) As Integer 'array to hold accumalated values
    Dim arrCount(1 To 19, 1 To 20) As Integer 'array to hold count of values
    to

    Dim arrVals(1 To 19, 1 To 20) As Single 'array to hold accumalated values
    Dim arrCount(1 To 19, 1 To 20) As Single 'array to hold count of values
    K :-)

  3. #3
    You are the man K!! Now I just need to figure out how to get the data points for those values.

Posting Permissions

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