+ Reply to Thread
Results 1 to 14 of 14

Array formula not expanding to match lines added to table

  1. #1
    Registered User
    Join Date
    02-23-2012
    Location
    FL
    MS-Off Ver
    Excel 365 2210
    Posts
    19

    Array formula not expanding to match lines added to table

    I have a number of array formulas that refer back to the table in the top left. The array formulas are in Columns I and L, and cells N200, N203, and P203.

    Normally when I add a new line to the top left table (usually by clicking on the empty box below the previous final line and typing the date), the table expands by one row and the array formulas all adjust to match, i.e. all the A180/C180s in the formulas become A181/C181s, etc.

    However every once in a while (maybe once a month), the arrays simply refuse to update, and I can't figure out why. When they fail, they all fail, it's not hit or miss. You'll see in the attached sheet that though I've added a line to the table (A181) and data to that line, all the arrays still read through A180/C180.

    Can someone explain to me why this randomly fails to update, and if it's something I'm doing incorrectly?

    And that leads to an associated question. In the past when this has failed in this manner, I've laboriously gone through and changed all the cell references manually, in every single individual cell. (After doing it once, the arrays usually magically start auto-expanding again.) I'm certain there is a way to make those formulas refer to a named range, instead of all being manual references, but after spending an hour on it, I keep getting #VALUE errors. I've been using http://spreadsheetpage.com/index.php...named_formula/ and pages like it as a reference without success. Obviously, I would prefer that the formulas auto-update without issue per my first issue above, but in the event that they don't, it'd be really nice to just change the ranges in one location and have that propagate across the sheet.
    Attached Files Attached Files
    Last edited by justmatt; 05-03-2014 at 10:52 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Array formula not expanding to match lines added to table

    If you clear the Date Filter and look at row 2 down to 23 you will see that there are no formulae in the cells.

    That's the reason that you're not getting them copied down ... Excel stores the formulae (somehow) in the first row of Table data. You don't have any formulae there so it has nothing to copy down.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Array formula not expanding to match lines added to table

    1) You don't need array formulas in your application
    2) Your formulas are referencing standard ranges...not structured table references
    3) Hardcoding the dates in the formulas when you have dates to reference directly is labor intensive.

    Try these regular formulas, copied down, in your file:
    Please Login or Register  to view this content.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Array formula not expanding to match lines added to table

    (2) Your formulas are referencing standard ranges...not structured table references
    Shouldn't make a difference. It will still auto-expand but it has to know what the formula is. And, in this case, it looks as though the formulae have been deleted.

    Regards, TMS

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Array formula not expanding to match lines added to table

    It "shouldn't" make a difference...However, as a matter of clarity:
    If I specifically and unambiguously want a formula to reference a table field, I either:
    • Use a structured table reference
    or
    • reference a Named Range that references the table field

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Array formula not expanding to match lines added to table

    Not sure of the point you're making. If the formula hasn't been "stored" in the Table in the first row of data, it won't be copied to new rows. AFAIAA, you can use whatever formulae you want in a Table, but clearly it makes sense to use Structured Table References ... and that is what you'd get if you select cells in the Table when you create the formula. But, if you manually type a formula using traditional cell references, they will calculate as normal.

  7. #7
    Registered User
    Join Date
    02-23-2012
    Location
    FL
    MS-Off Ver
    Excel 365 2210
    Posts
    19

    Re: Array formula not expanding to match lines added to table

    @TMS: I understand the error you're pointing out, and why it's happening, but that's a separate issue from what I was asking about. To fix that I need to figure out how to translate the idea of "moving average of this line and up to the previous 22 lines" into a formula. So D24 averages B2:B24 and D25 would average B3:B25, but D10 would only average B2:B10, because that's all that's available. Once I figure out how to write that formula, I can fill D & E columns all the way from the top down (fixing the issue you pointed out), and the formulae will start copying automatically when the table expands.

    @Ron: Those formulae worked perfectly to both fix my issue and save me laborious corrections. Thanks!

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Array formula not expanding to match lines added to table

    Looks like we agree

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Array formula not expanding to match lines added to table

    Here is your file with a simple solution to the formula problem in the first 20 app rows. I just inserted rows above the table and hid them. The table works properly.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  10. #10
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Array formula not expanding to match lines added to table

    There are several problems with the original file.
    In the file you attached, when I add a row to the referenced table it has no impact on the array formulas....their references do not include the new row. Those array formulas need to be changed. I still recommend the non-array, structured-table-reference formulas I posted.

  11. #11
    Registered User
    Join Date
    02-23-2012
    Location
    FL
    MS-Off Ver
    Excel 365 2210
    Posts
    19

    Re: Array formula not expanding to match lines added to table

    Quote Originally Posted by newdoverman View Post
    Here is your file with a simple solution to the formula problem in the first 20 app rows. I just inserted rows above the table and hid them. The table works properly.
    Sometimes the simplest solutions are the best, and the easiest to overlook. Thanks for reminding me of that.

  12. #12
    Registered User
    Join Date
    02-23-2012
    Location
    FL
    MS-Off Ver
    Excel 365 2210
    Posts
    19

    Re: Array formula not expanding to match lines added to table

    Quote Originally Posted by Ron Coderre View Post
    There are several problems with the original file.
    In the file you attached, when I add a row to the referenced table it has no impact on the array formulas....their references do not include the new row. Those array formulas need to be changed. I still recommend the non-array, structured-table-reference formulas I posted.
    Exactly. That was my original problem, that the array formulae were not being impacted. It would work fine for weeks at a time, with the arrays being updated appropriately, and then one day just... nothing, and no good reason why. But the new formulae you provided above work better, and don't require extra work. So I've just replaced all the old array formulae with the new ones. Thanks again for your help.

  13. #13
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Array formula not expanding to match lines added to table

    Glad you got something you can use!

  14. #14
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Array formula not expanding to match lines added to table

    Hmmmm. I don't know what is going on. The some cell references update correctly for me and some don't with the file I uploaded. When I first opened it, after your message, it seemed to work....then it didn't at all.

    I give up.....something really wrong with this.

    This seems to be better:---at least when I download the file it seems to work.
    Attached Files Attached Files
    Last edited by newdoverman; 05-03-2014 at 02:41 PM.

+ 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. [SOLVED] Match up 2 lines to their values in a table and check condition.
    By stockgoblin42 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-26-2013, 10:52 AM
  2. Replies: 3
    Last Post: 06-14-2010, 08:22 PM
  3. Expanding + box to show lines of detail
    By Chemistification in forum Excel General
    Replies: 2
    Last Post: 05-14-2010, 09:43 AM
  4. [SOLVED] Need an Expanding array formula
    By havocdragon in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-05-2005, 06:05 AM
  5. Excel formula in an expanding table
    By Keady in forum Excel General
    Replies: 1
    Last Post: 07-30-2005, 01:05 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