+ Reply to Thread
Results 1 to 8 of 8

Array bogging down CPU

  1. #1
    Registered User
    Join Date
    07-20-2021
    Location
    Florida
    MS-Off Ver
    Office Pro 2016
    Posts
    8

    Array bogging down CPU

    I built a BP tracker about 4 years ago, and have added a feature here and there over time. One of the features is an array which shows the dates for a week. After cutting out all the other sheets I've figured out this column bogs down the computer significantly on saves (I've had to disable auto calculation in order for it to work). In the full sheet, with ~5,100 entries and a similar formula on another sheet, it'll take roughly 8 minutes to save on my home computer (an Alienware), and ~31 minutes on my work computer (basic HP). Is there a way I can achieve the same result without the lag?
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,407

    Re: Array bogging down CPU

    Are you still using Excel 2016?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,407

    Re: Array bogging down CPU

    It's your named ranges - they are full column references, so over a million rows each. I've removed them.

    Use this instead:

    =IF(A2 = "", "", TEXT(MIN(IF($A$2:$A$10000 = A2, $E$2:$E$10000)), "d mmm yy")&" - "&TEXT(MAX(IF($A$2:$A$10000 = A2, $E$2:$E$10000)), "d mmm yy"))

    and this:

    =CHOOSE(WEEKDAY(E3),"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

    If you must use named ranges, limit them.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,309

    Re: Array bogging down CPU

    Change the named ranges "Year_week" and "Date" to be sensible maxima e.g $A1:$A6000
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    07-20-2021
    Location
    Florida
    MS-Off Ver
    Office Pro 2016
    Posts
    8

    Re: Array bogging down CPU

    Reducing the number of columns referenced helped with processing.
    Also, thanks for the second part; I've never seen the CHOOSE function, and while this is helpful here it will be useful moving forward.

  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,543

    Re: Array bogging down CPU

    Please see the attached updated sample file.

    I have changed all the full column Named Ranges into Dynamic Named Ranges based on column A.

    For example, Year_Week:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And, Weekday:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Column C (Weekday) can be just =E2, formatted as "dddd" and copied down, rather than:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And I've used this (slight tweak) for the range:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    I've left in a lot of "test columns" from J onwards that demonstrate the different elements that can be extracted and/or combined. They can all be deleted.

    Calculation is immediate even with all the extra columns.
    Attached Files Attached Files
    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


  7. #7
    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,543

    Re: Array bogging down CPU

    Edit: deleted - misread earlier response.
    Last edited by TMS; 03-03-2024 at 05:33 PM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,407

    Re: Array bogging down CPU

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, remember that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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] VBA Countifs bogging down 386K+ rows
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-09-2023, 08:31 AM
  2. Replies: 2
    Last Post: 07-10-2023, 12:26 PM
  3. BVA Routine Bogging Down Excel Sheet
    By marmor28 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2019, 11:12 AM
  4. Replies: 5
    Last Post: 02-22-2018, 01:47 AM
  5. [SOLVED] Quick Array question - Copy array to another array then resize?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-02-2013, 01:17 AM
  6. Timer in Mac OSX Lion VBA bogging down after about 60 seconds
    By dboone21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2012, 12:34 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