+ Reply to Thread
Results 1 to 12 of 12

Referencing a formula that will automatically update several cells

  1. #1
    Registered User
    Join Date
    08-22-2014
    Location
    Cape town South Africa
    MS-Off Ver
    Office 365
    Posts
    4

    Referencing a formula that will automatically update several cells

    I have a spreadsheet calculating the average of numerical values in different rows. Each month a new column of data is added and the formula for average has to be changed on each row to reflect the average of the data for the last six columns.

    Every time I update the data, have to change the formula on every row.

    Can I have one formula cell that can be updated to reflect the average of the last six columns that can in turn be referenced by all the other rows that need to have their formula updated so that this is done automatically. In other words would only have to update the one cell in order for all the other cells to be updated?

  2. #2
    Registered User
    Join Date
    06-27-2013
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Referencing a formula that will automatically update several cells

    You could try just having an formula that looks like:
    "=average(A1:F1)"
    and copy that cell to the right as data gets added

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Referencing a formula that will automatically update several cells

    Update sample file how data looks for different months and where you want average.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Referencing a formula that will automatically update several cells

    Hi joevan,

    The INDIRECT function may be able to solve your problem. For example if your formula is:
    Please Login or Register  to view this content.
    Now I'll try to interpret what I just did.
    Cell C11 contains the value 'A'
    Cell C12 contains the value 'F' (from the following formula: =CHAR(CODE(C11)+5))
    ROW() returns the current row number

    (INDIRECT($C$11 & ROW()&":" & $C$12 & ROW()) becomes A5:F5 as follows:
    a. $C$11 is 'A'
    b. ROW() is 5 (i.e. the current row number)
    c. : (self explanatory)
    d. $C$12 is 'F'
    e. ROW() is 5 (i.e. the current row number)

    There is a limitation that the last row being averaged is Column 'Z', so the maximum legal value for cell 'C11' is 'U'.

    The limitation can be eliminated by either:
    a. Manually entering the column in cell $C$12
    b. Using R1C1 notation - formula conversion is beyond my skill level.
    c. Using Macros to calculate two character column numbers

    Please Login or Register  to view this content.
    See the attached sample workbook with a working example.

    Lewis

  5. #5
    Registered User
    Join Date
    08-22-2014
    Location
    Cape town South Africa
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Referencing a formula that will automatically update several cells

    How do I upload this spreadsheet so that you can see it?

  6. #6
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Referencing a formula that will automatically update several cells

    To upload a file:

    Below the reply box where you enter text, press 'Go Advanced'.


    When you scrool down, below the message box, you will find a button labelled 'Manage Attachments'. Clicking this button will open a new window for uploading attachments. You can upload an attachment either from your computer or from another URL by using the appropriate box on this page. Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file. To upload a file from another URL, enter the full URL for the file in the second box on this page. Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window. You can then close the window to return to the new post screen.

  7. #7
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Referencing a formula that will automatically update several cells

    Check it out the attachment,
    Attached Files Attached Files
    Click just below left if it helps, Boo?ath?

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Referencing a formula that will automatically update several cells

    This makes an average for each row, for the most recent N columns, where N is defined in cell B17.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  9. #9
    Registered User
    Join Date
    08-22-2014
    Location
    Cape town South Africa
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Referencing a formula that will automatically update several cells

    Spreadsheet is attached for reference

    The cells highlighted in green are the cells containing the formula that I want to update from a central point.
    Currently the six month average is column "N" to "S" once the September data in entered the new six month average period should be "Column "O" to "T"

    I have only included two sets of data (Stock Items)on this spreadsheet, generally there will be in the region of 25 sets of data meaning that the Average for each set must be manually changed to move to the next column forward.

    I want to be able to make one change that will update the formula for each stock item, and reference the current cells highlight4ed in green to that one cell.

    Hope this makes sense!
    Attached Files Attached Files

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Referencing a formula that will automatically update several cells

    You caused a bit of panic there, as it looked like a TOTALLY different problem from the one you started with. Nowhere, before Post 10, did you say that there were values in the cells for the months that are still to come! However, there was an easy way round it. I have left it so that you can change the rolling average period by adjusting the number in column AA. At the moment these can be done individually, or all set from one cell for the sheet, or simply hard-coded as the digit 6.

    Decide what you want & try it out. If it trips you up, shout. It'll only take a moment to fix.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-22-2014
    Location
    Cape town South Africa
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Referencing a formula that will automatically update several cells

    Thanks Glen, this got me on the right track!

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,067

    Re: Referencing a formula that will automatically update several cells

    If that's it; please mark the thread as solved and (preferably) say thanks to those who helped by clicking the Add Reputation button at the foot of their posts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 05-16-2013, 02:15 AM
  2. Replies: 1
    Last Post: 08-09-2012, 11:38 AM
  3. Do not want cells to update automatically
    By James12 in forum Excel General
    Replies: 3
    Last Post: 07-07-2009, 06:05 PM
  4. Automatically update cells
    By Maddoktor in forum Excel General
    Replies: 1
    Last Post: 12-07-2005, 09:00 PM
  5. [SOLVED] Formula referencing deleted row (move up automatically)
    By Paulymon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-17-2005, 05:06 PM

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