+ Reply to Thread
Results 1 to 6 of 6

Automatic formula changer?

  1. #1
    Registered User
    Join Date
    02-06-2007
    Posts
    2

    Automatic formula changer?

    Hi!
    How do I get so that I won´t have to change the formula if I add a cell to the formula?

    A1=5
    A2=10
    B1=(A1+A2)/2

    add 1 cell.


    A1=5
    A2=10
    A3=2
    B1=(A1+A2+A3)/3

    How do I get Excel to automaticly realize that there has come a new cell AND that Excel should change the formula.

    Is it possible?

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    =AVERAGE(1:1)

    This will average all non-blank cells in row 1.

  3. #3
    Registered User
    Join Date
    02-06-2007
    Posts
    2
    Quote Originally Posted by jasoncw
    =AVERAGE(1:1)

    This will average all non-blank cells in row 1.

    Ok, but what If I want the average to be at the end of row 1?

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Unless you know how many cells you might need to input (e.g. 20), then it would be a little difficult to accomplish this. It would be much easier to include the average in column A for the rest of the columns, and use:

    =AVERAGE(B1:Z1)

    or how many columns you would like (they go up to column IV).

    If you know that you will never use more than say 10 amounts, use the average formulas in all rows in column K (the 11th column), and use:

    =AVERAGE(A1:J1)

    HTH

    Jason

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    jasoncw,

    Could you use a dymanic range ??

    http://www.contextures.com/xlNames01.html#Dynamic

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Oh, sure, you could definitely use dynamic ranges to determine the average range, but without VBA, I really don't know how to "move" the average result to the end of the dynamic range.

    In other words, for ato's example, if there are numbers in cells A1, A2, and A3, with the average in A4, I don't know of a way to "move" the average from A4 automatically if another number is entered in row 1.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1