An excel formula question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dcat2
    SBR Rookie
    • 01-24-12
    • 9

    #1
    An excel formula question
    I have isolated a large number of sets of 42 to 84 numbers arranged in columns. I want to write a (loop? code? equation?) that will place the previous average adjacent to the next cell. This means if my numbers going downwards read 20,40,40,80,20 then the adjacent column would read -- , 20 , 30 , 33.3 , 45. These numbers represent the average of all the numbers in the original column that come before this row. How can this be done? Thanks

    EDIT: Problem solved
    Last edited by dcat2; 02-08-12, 01:09 AM. Reason: Problem Solved
  • bink
    SBR Rookie
    • 10-15-11
    • 36

    #2
    You could do a simple equation. Assuming your original column starts at A1 and you average column starts at B2 then something like SUM(A$1:A1)/COUNT(A$1:A1). That's the simplest way. Or just use the AVERAGE function. AVERAGE(A$1:A1).
    Comment
    • trevlyn1983
      SBR Wise Guy
      • 05-25-09
      • 940

      #3
      easiest way I can think of is . go to the Next column . second row and type =AVERAGE($A$1:A2)
      Comment
      • trevlyn1983
        SBR Wise Guy
        • 05-25-09
        • 940

        #4
        bink beat me lol ~
        Comment
        • MonkeyF0cker
          SBR Posting Legend
          • 06-12-07
          • 12144

          #5
          With VBA, you'd do something like this...

          Code:
          dim total as integer
          for i = 0 to 83
               total = total + Range("A1").Offset(i, 0)
               Range("A1").Offset(i, 1) = total / (i + 1)
          next
          This assumes a column containing 84 numbers starting at cell A1 and placing the running average in the B column.
          Comment
          • dcat2
            SBR Rookie
            • 01-24-12
            • 9

            #6
            thanks guys, this worked great
            Comment
            SBR Contests
            Collapse
            Top-Rated US Sportsbooks
            Collapse
            Working...