Automatically update formulas to include new rows

I have a sheet, titled working, that does a lot of the calculations from other sheets that I will ultimately need on a summary sheet in the future. The problem is, the formulas on the working sheet don't automatically update when I add a new row on the data entry sheet.

Here is a link to download the spreadsheet from my SkyDrive if that will make it any easier (it uses Macros, so you will need to download it):

https://skydrive.live.com/redir.aspx?cid=d18ade3fc16e855a&resid=D18ADE3FC16E855A!9361&parid=D18ADE3FC16E855A!117&authkey=!AAC20cqKniiYLco

Any ideas?

-------------Problems Reply------------

I see that there is some worksheet code in it, but there is an empty code module. But not needed.

You can use the INDIRECT() and COUNTA() functions in your formulas on the [Working] worksheet to create dynamic formulas:

In B1 you have: =SUM('Company A'!G3:G3)

Now, a couple of assumptions are made with the following: that G1 is empty, so we must account for it when we do the COUNTA() operation; and that entries in column G and the others will not have empty rows in the data area of the sheet.

Try this in C1 as a replacement for B1's formula:

=SUM(INDIRECT("'Company A'!G3:G"&COUNTA('Company A'!G:G)+1))

We have made a "constant" value out of the

'Company A'!G3:G

part of the original formula, and then use the COUNTA(G:G) to count all entries in column G and add 1 to that result to account for the empty G1 cell. As you add entries into column G on the [Company A] sheet, that COUNTA(G:G) value is going to increase, making for a dynamic formula.

You can similarly modify all other formulas to get their exact range.

But I would also consider the two recommendations that Hans_V put up: of using "oversized" range references. With the entire column type of reference (as =SUM('Company A'!G:G) ] there is the potential for a performance hit, so his first suggestion of picking a large range that is sufficient to capture all expected entries on a sheet would be the better choice. I'd start with a guestimate of the maximum number of entries on a 'Company' type sheet and double it and as time goes on and you can examine actual number of entries you could even tweak that number down to one with a 'safe' overhead, but without so much overhead as to affect performance to an unacceptable level.

OR go with my suggestion to get exact ranges to work with, with the slight overhead of using COUNTA() and INDIRECT() a couple of dozen times on a sheet.

The workbook does not contain any code, but anyway: why not use a larger range than you'll be likely to fill, e.g. in Working!B2:

=SUM('Company A'!G3:G1000)

or even

=SUM('Company A'!G:G)

That's odd because it has code on my end, and it had it when I uploaded.

I could do it that way, I was just hoping for a cleaner solution than that, but if that's the only solution then so be it I guess.

I see that there is some worksheet code in it, but there is an empty code module. But not needed.

You can use the INDIRECT() and COUNTA() functions in your formulas on the [Working] worksheet to create dynamic formulas:

In B1 you have: =SUM('Company A'!G3:G3)

Now, a couple of assumptions are made with the following: that G1 is empty, so we must account for it when we do the COUNTA() operation; and that entries in column G and the others will not have empty rows in the data area of the sheet.

Try this in C1 as a replacement for B1's formula:

=SUM(INDIRECT("'Company A'!G3:G"&COUNTA('Company A'!G:G)+1))

We have made a "constant" value out of the

'Company A'!G3:G

part of the original formula, and then use the COUNTA(G:G) to count all entries in column G and add 1 to that result to account for the empty G1 cell. As you add entries into column G on the [Company A] sheet, that COUNTA(G:G) value is going to increase, making for a dynamic formula.

You can similarly modify all other formulas to get their exact range.

But I would also consider the two recommendations that Hans_V put up: of using "oversized" range references. With the entire column type of reference (as =SUM('Company A'!G:G) ] there is the potential for a performance hit, so his first suggestion of picking a large range that is sufficient to capture all expected entries on a sheet would be the better choice. I'd start with a guestimate of the maximum number of entries on a 'Company' type sheet and double it and as time goes on and you can examine actual number of entries you could even tweak that number down to one with a 'safe' overhead, but without so much overhead as to affect performance to an unacceptable level.

OR go with my suggestion to get exact ranges to work with, with the slight overhead of using COUNTA() and INDIRECT() a couple of dozen times on a sheet.

Hi,

Select range A2:N3 on the Company A sheet and press Ctrl+T to convert to a Table. Now as and when you add data by rows to the Company A sheet, the formulas in column B of Working sheet will include those new rows added.

Category:Office Views:9 Time:2014-01-28

Related post

  • Automatically update formula field after generating Open XML Word document 2010-06-26

    I have a library that generates Word documents using the OpenXML SDK, one of the functionalities of the library is the generation of tables with formulas on the last row (such as SUM(ABOVE)). Word has these functions built-in, but when generating the

  • Macro to automatically update formulas when creating a new worksheet 2012-04-01

    Hi, I've created a report to track incoming products where there's an itemized count of units by type on a given day they're received in. My workbook has a 'totals' worksheet containing formulas to compile the data from the rest of the worksheets in

  • Updating formulas as columns and rows are added. 2014-02-10

    I've created a spreadsheet with formulas, which is intended for use by others, who may or may not understand formulas. I would like the users to be able to add a column or a row, and have the range automatically change in the formula to reflect the a

  • How to automatically update a timestamp when rows in other other linked tables are updated 2011-08-06

    I have a timestamp which updates when the row is updated in my main table. Many tables are linked to it via the ID Primary key. But i want this time stamp automatically updated whenever the other connecting rows from other tables too get updated. How

  • Word 2010 VBA: Macro to Update Formulas in a Table ?? 2012-07-15

    Hello; 1) Word 2010 doesn’t automatically update formulas after changes, and I keep forgetting to right-click each formula cell and press Update Field. Under Options -> Advanced -> Print options, One may check the box: Allow Fields to update be

  • Can macros be set up to automatically update? 2012-12-31

    Can macros be set up to automatically update if extra columns or rows are added to the worksheet? EG a macro looks at rows 1 to 10 but a row is added so the macro would need to look at 1-11 --------------Solutions------------- Hi, Yes they can IMO it

  • How do I write a formula to automatically update 1 row based on values input into a table. 2013-11-27

    Hi. I am trying to see if I can automate a formula to populate cells in a row based on inputs from another sheet. On sheet 1, assume I have month and year going across row 1 (e.g., Jan-13, Feb-13, etc.). In row 2, I have supply that is made at variou

  • Automatically adjust formulas to account for inserted rows? 2012-11-14

    I have a large spreadsheet containing survey responses with the questions across the columns and the responses down the rows. I downloaded the raw data from the survey company's web site, formatted the spreadsheet to make it more usable, and added fo

  • Apply existing formula to a new row automatically. 2013-09-06

    Hello, I am trying to find out how to automatically apply an existing formula to a new row. For example, I insert a new row and then type in an amount in D and I want Excel to generate another amount in G by using a formula. What I am trying to do is

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.102 (s). 11 q(s)