+ Reply to Thread
Results 1 to 13 of 13

Array Formulas for Faster Calculations ?

  1. #1
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Array Formulas for Faster Calculations ?

    Hello,

    I've hourly data extracted from a transactional system which is used for a scatter plot chart.

    I'm trying to summarize this data extract to load it into a transactional database.
    I need some help to build array formulas in Excel (instead of the SUBTOTAL function I've used) that can calculate results faster.

    As the data spans for 24x7x365 (and by hour), the number of records is high (more than 100,000+ rows of data is generated per year).

    Can some one help code the array formulas to summarize for calculating the average LogIn-Logout time and Standard Deviation per day & per month ?
    The SUBTOTAL function takes too much time to calculate and the workbook calculations take long to refresh when filters are used.

    I also tried coding the formulas using SUMPRODUCT & SUMIFS function, but unable to zero in on the appropriate formula that can calculate results faster.

    Can someone help ?



    Sarang
    Attached Files Attached Files

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

    Re: Array Formulas for Faster Calculations ?

    Why you are using same formula, all are giving same result, in all rows in E, F, G & H columns.
    Last edited by kvsrinivasamurthy; 03-23-2019 at 03:24 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Re: Array Formulas for Faster Calculations ?

    The formulas in E & F, calculate for the month as a whole, whereas the same formulas are coded in G & H (using SUBTOTAL function) will vary when filtered by day (column B).

    I'm looking to code formulas in the Summary worksheet to calculate AVERAGE and STDEV.P by day (which currently work through SUBTOTAL), as well as for the whole month.

    When more data present is added to the worksheet (for multiple months), I may need to repeatedly apply & clear filters on column B in Response Time Data worksheet which causes the formulas to recalculate repeatedly, thereby leading to slowness. Using SUBTOTAL takes more time to calculate as data gets added to the worksheet every month. So I'm looking for array calculations which execute faster.
    Last edited by Sarang_1984; 03-23-2019 at 03:43 AM.

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

    Re: Array Formulas for Faster Calculations ?

    Date in J3
    For average
    For Day
    Please Login or Register  to view this content.
    For Month
    Please Login or Register  to view this content.
    Below are ARRAY formulas
    For Stdev.p
    For day
    Please Login or Register  to view this content.
    For Month
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Re: Array Formulas for Faster Calculations ?

    Srinivas' array formulas doesn't seem to work properly. Refer the attached file below.
    I'm also looking for more dynamic formulas that can adjust to the worksheet data range automatically.

    Can someone help code the Array formulas correctly ?
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Array Formulas for Faster Calculations ?

    Dynamic named ranges:
    EventTime ='Response Time Data'!$A$2:INDEX('Response Time Data'!$A:$A,COUNTA('Response Time Data'!$A:$A))
    LogInLogOut__secs ='Response Time Data'!$D$2:INDEX('Response Time Data'!$D:$D,COUNTA('Response Time Data'!$A:$A))
    SummaryDate ='Response Time Data'!$J$3


    K3
    Please Login or Register  to view this content.
    L3
    Please Login or Register  to view this content.
    M3
    Please Login or Register  to view this content.
    N3
    Please Login or Register  to view this content.


    O17: Average
    Please Login or Register  to view this content.
    P17: Stdev.P
    Please Login or Register  to view this content.

    ***...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    A Pivot Table is much easier:
    Attached Files Attached Files
    Last edited by protonLeah; 03-23-2019 at 08:12 PM. Reason: added file w/pt
    Ben Van Johnson

  7. #7
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Re: Array Formulas for Faster Calculations ?

    The array formulas in columns O17 & P17 work good, but I want to calculate SUMPRODUCT & STDEV.P only for non-blank cells or cells >0 in column D.
    Last edited by Sarang_1984; 03-23-2019 at 08:53 PM.

  8. #8
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Re: Array Formulas for Faster Calculations ?

    Bumping Thread ..

  9. #9
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Array Formulas for Faster Calculations ?

    you expand the solutions you have with the condition (LogInLogOut__secs>0)
    =SUMPRODUCT(--(INT(EventTime)=$J17)*(LogInLogOut__secs)*(LogInLogOut__secs>0))/SUMPRODUCT((INT(EventTime)=$J17)*(LogInLogOut__secs>0))

    =STDEV.P(IF(INT(EventTime)=$J17,IF(LogInLogOut__secs>0,(LogInLogOut__secs),"")))

  10. #10
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Re: Array Formulas for Faster Calculations ?

    These formulas work perfectly fine.

    One question though - Does the average and STDEV.P calculation be reset automatically at the start of every month ?
    Will the formulas need to be adjusted for the calculations to restart every month ?

  11. #11
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Re: Array Formulas for Faster Calculations ?

    Bumping thread ..

  12. #12
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Array Formulas for Faster Calculations ?

    You would be quicker making changes and seeing if the formulas change. Even if you dont full understand the formulas you could manually change a few values in the data and observe the result. Part of the aim of the forum is to encourage learning, and this would be a small step along the way. Your next question might be that you want to change something else as a result of this experimenting, and you could have asked that earlier and so got a solution earlier.

    They are all based on the values in j17:j44 , if you change the month you would have to change the values in these cells, but that would not take long to do. You could even just make j18 =j17+ 1 and copy down. Then you would only need to adjust the first value when it was a new month

  13. #13
    Registered User
    Join Date
    03-23-2019
    Location
    South Pasadena, California
    MS-Off Ver
    2010 and above
    Posts
    8

    Re: Array Formulas for Faster Calculations ?

    Thanks for all the help !! You have saved my time a lot by making Excel do faster calculations..

+ 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. Make model faster: convert formulas to text and then back to formulas
    By lucassdm7 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-25-2019, 06:49 AM
  2. Reverse IRR calculations, sorting data formulas, faster goal seek options
    By dude111 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-12-2017, 09:09 AM
  3. [SOLVED] A faster way to make a long formula work to cut down on calculations?
    By greenfox74 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2017, 05:01 AM
  4. making formulas faster
    By ammartino44 in forum Excel General
    Replies: 5
    Last Post: 09-20-2014, 05:56 AM
  5. Faster alternatives to array formulas
    By Spellbound in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-10-2012, 08:37 PM
  6. Trying to find a faster solution than array formulas
    By travkliewer in forum Excel General
    Replies: 3
    Last Post: 09-09-2007, 04:12 AM
  7. How can I make this faster...array?
    By excelnewbie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2005, 04:19 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