Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    13
    Thanked 1 Time in 1 Post

    Specifying range height for AVERAGE function? (Excel 2002)

    Suppose I want to calculate averages where the number of cells to be averaged will vary. Is there a way to tell Excel formulaically that I want to average only X number of cells in a column?

    For example, say I have a very long column of numbers, let's call them data cells. In the next column I am calculating averages. Sometimes I want to average 30 of the data cells, sometimes, 5, etc. It would be great if I could type 30 and 5 somewhere and have the average formula reference one of these, so that the formula "knows" how many cells to average. Is this possible?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Specifying range height for AVERAGE function? (Excel 2002)

    Let's say that you want to compute the average of the first n items in column A i.e. of A1:An where n is variable.
    Enter the value of n in - for example - cell C1.
    The following formula will return the average:

    =AVERAGE(INDIRECT("A1:A"&C1))

    If the range doesn't begin in row 1, you'll have to adjust the formula.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    13
    Thanked 1 Time in 1 Post

    Re: Specifying range height for AVERAGE function? (Excel 2002)

    Hans to the rescue, as always!

    Thanks my friend

    Lingayi

Posting Permissions

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