+ Reply to Thread
Results 1 to 5 of 5

Formula does not update when sorting

Hybrid View

  1. #1
    Registered User
    Join Date
    12-30-2011
    Location
    CA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Formula does not update when sorting

    It seems whenever we sort, the following formulas do not update with the correct row. In the example below the "Updates!$A4" reference stays A4 no matter what row it is sorted to. We have to have our spreadsheet set to manual calculation due to the intensive calculation process (which we only need once a day). I would also not be opposed to recommendations for rewriting this formula all together. I have tried absolute, relative and mixed, but it still stays the same.


    Formula: copy to clipboard
    =IF(SUMIFS(PaceData!$E:$E,PaceData!$A:$A,Updates!$A4,PaceData!$C:$C,Updates!JD$3)=0,SUMIFS(PaceData!$D:$D,PaceData!$A:$A,Updates!$A4,PaceData!$C:$C,Updates!JD$3),TEXT(SUMIFS(PaceData!$E:$E,PaceData!$A:$A,Updates!$A4,PaceData!$C:$C,Updates!JD$3),"MM/DD/YY")&" A")

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula does not update when sorting

    How many rows are you working with?

    Your formula is currently showing undeclared row references, which means you're calculating against 1.04 million rows per column reference.

    Even if you're crunching only 150,000 rows, your formula will process in 1/10 the time if you just manually adjusted your references to:

    =IF(SUMIFS(PaceData!$E1:$E150000,PaceData!$A1:$A150000,Updates!$A4, PaceData!$C1:$C150000,Updates!JD$3)=0,
        SUMIFS(PaceData!$D1:$D150000,PaceData!$A1:$A150000,Updates!$A4,PaceData!$C1:$C150000,Updates!JD$3),
    TEXT(SUMIFS(PaceData!$E1:$E150000,PaceData!$A1:$A150000,Updates!$A4,PaceData!$C1:$C150000,Updates!JD$3),"MM/DD/YY")&" A")
    Also, applying a couple of manual line breaks via Alt+Enter makes managing large formulas much, much easier.


    As for adjustable references, you may wish to use OFFSET or INDIRECT. However, these are volatile functions and update every time anything changes so they again would take up extra processing power.

    Perhaps you could attach an example of your data, and we could proof your table design for inefficiencies.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    12-30-2011
    Location
    CA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Formula does not update when sorting

    You're exactly right. I set these formulas up prior to knowing how many records the import file would contain. I will definitely change that to "PaceData!$E1:$E150000". The spreadsheet is attached. Any idea why the reference is not updating when sorting?

    Thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Formula does not update when sorting

    You are sorting the formulas as well as the data, so their references are moving as well. This will always happen when sorting formulas as far as I am aware, unless you convert to a multi-cell array formula
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula does not update when sorting

    I'm curious to see if the processor heavy formulas could be replace with a VB loop that pulls each corresponding value.

    Then, you could sort without volitility, and at whim, update values with another VB run that wipes everything out and pulls fresh.

    I will tinker as I find free time.

    At any rate, here's the original version updated with declared ranges. My computer calculates this in about 45 seconds.
    Attached Files Attached Files

+ 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. automatic update of table and sorting
    By runt1 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-07-2010, 08:56 AM
  2. Relative references do not update when sorting
    By andes0 in forum Excel General
    Replies: 1
    Last Post: 07-17-2009, 03:11 PM
  3. Realtime Data Update Sorting
    By devada1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2006, 10:30 AM
  4. Combo Box Sorting Update Problem
    By kanuvas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2005, 05:16 AM
  5. sorting data problem - linked worksheets don't update
    By liam in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 03-09-2005, 08:19 AM

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