+ Reply to Thread
Results 1 to 11 of 11

How to convert Array formula into Regular one to avoid long calculation time

  1. #1
    Registered User
    Join Date
    07-24-2016
    Location
    Egypt
    MS-Off Ver
    2016
    Posts
    8

    How to convert Array formula into Regular one to avoid long calculation time

    Hi everyone, in the attached example, in cell (E11), I want to count unique customers which purchased product 1, their area code matches with the corresponding code in cell (D11), and only purchased less than 5 units

    I use the following array formula:

    =SUM(IF(FREQUENCY(IF($G$2:$G$7=D11,IF($I$2:$I$7="Product 1",IF($J$2:$J$7<5,IF($E$2:$E$7<>"",MATCH($E$2:$E$7,$E$2:$E$7,0))))),ROW($E$2:$E$7)-ROW(G2)+1),1))

    It works perfectly, but when using this formula through huge database which contains tons of customers, product& areas. Excel take very long time to calculate this function in a table column consists of +1000 cells, It takes about 10 minutes to calculate only one column which is possible to continue like that

    Is there any way to convert this Array function into regular one by using helper columns or whatever to avoid all this time waiting for calculations

    Any help will be appreciated to the maximum, thanks a lot in advance
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by ibraam; 07-24-2016 at 12:42 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Hi ibraam and welcome to the forum,

    This looks like it could be a Pivot Table answer. Can you attach your sample workbook instead of a picture so I can try to Pivot it and see if our results match?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    07-24-2016
    Location
    Egypt
    MS-Off Ver
    2016
    Posts
    8

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Quote Originally Posted by MarvinP View Post
    Hi ibraam and welcome to the forum,

    This looks like it could be a Pivot Table answer. Can you attach your sample workbook instead of a picture so I can try to Pivot it and see if our results match?
    First thanks a lot for your reply, would you kindly find my attached example excel sheet ... I Edited mu subject to attache it

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Hi,

    See if the attached Pivot Table does what you need. See if it is much faster. I filtered by Customer and Product. Then only by Area Code.
    I did a count of products and you can filter by that number using a Values Filter in the Row Label dropdown.

    Pivot instead of Array Formula.xlsx

  5. #5
    Registered User
    Join Date
    07-24-2016
    Location
    Egypt
    MS-Off Ver
    2016
    Posts
    8

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Quote Originally Posted by MarvinP View Post
    Hi,

    See if the attached Pivot Table does what you need. See if it is much faster. I filtered by Customer and Product. Then only by Area Code.
    I did a count of products and you can filter by that number using a Values Filter in the Row Label dropdown.

    Attachment 471956
    thanks a lot for your appreciated help, at the same time i have to choose numbers less than 5 after filtering sales field, i:e I have to choose -2, 1, 2 manually. when dealing with huge date I may spent all day& night to mark specific sales values and ignore others. Is there any way to make the conditions (count unique customers if less than 5 ) or ( count unique customers if more than 5) an automatic option in my pivot table? .... Are You get it ?

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: How to convert Array formula into Regular one to avoid long calculation time

    I think my Pivot Table will do that if you use the Value Filter in Pivot Tables.

    See the picture at http://www.contextures.com/excel-piv...ers-top10.html

    See the part about "Value Filters".

  7. #7
    Registered User
    Join Date
    07-24-2016
    Location
    Egypt
    MS-Off Ver
    2016
    Posts
    8

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Quote Originally Posted by MarvinP View Post
    I think my Pivot Table will do that if you use the Value Filter in Pivot Tables.

    See the picture at http://www.contextures.com/excel-piv...ers-top10.html

    See the part about "Value Filters".
    Well. it works , thanks a lot. but the bigger challenge now that my original worksheet consists of 12 sheets referring to 12 months of a year named (Jan, Feb, Mar, ..... etc) and an extra sheet which is called analyzer in which i write my arrays formulas referring to January sheet as example when copying January sales report which has specific format i know very well and prepare my analyzer to match to, it will automatically automate everything and return tables and charts to my dashboard ... but now, I have to manually insert a pivot table to each month report separately with its specific range which may be different than other months reports range ... and do filters manually for each month and ... etc, the idea behind my first question is AUTOMATION, is there any way to automate every thing using pivot table once copying month report to its sheet on my analyzer workbook ? ... r u get the idea behind all this ... THAT WILL NOT MAKE ME NOT SAYING THANKS A LOT ANYWAY ")
    Last edited by ibraam; 07-24-2016 at 01:35 AM.

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

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Is it possible to sort the individual sheets (Eg: January, February, etc) on G column. Then it is possible to reduce time.

  9. #9
    Registered User
    Join Date
    07-24-2016
    Location
    Egypt
    MS-Off Ver
    2016
    Posts
    8

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Quote Originally Posted by kvsrinivasamurthy View Post
    Is it possible to sort the individual sheets (Eg: January, February, etc) on G column. Then it is possible to reduce time.

    Sorry, I can't understand what do you aiming for, any clarification will be appreciated

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

    Re: How to convert Array formula into Regular one to avoid long calculation time

    Now the Entire range(rows) is used. If data is sorted on G column the range can be reduced to rows having the required area code .

  11. #11
    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,169

    Re: How to convert Array formula into Regular one to avoid long calculation time

    I did a "volume" test for one month as follows:

    1177 rows of data, consisting of 200 customers, 27 areas, 50 products.

    With an output table of 27 Areas (rows) and 50 products (columns) the results were returned almost instantaneously.

    a table column consists of +1000 cells, It takes about 10 minutes
    Does this test reflect the above situation?

+ 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. Convert Julian date/ time to regular date/ time (MM/DD/YYYY HH:MM:SS)
    By dataguy30 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-07-2013, 11:33 AM
  2. Complex array formula takes long time to return results
    By holmes123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-02-2012, 05:36 PM
  3. Replies: 0
    Last Post: 04-23-2012, 10:06 AM
  4. Calculation takes long time
    By dorend in forum Excel General
    Replies: 10
    Last Post: 12-13-2011, 06:17 PM
  5. Ridiculously long calculation time
    By dbconfession in forum Excel General
    Replies: 1
    Last Post: 09-14-2009, 01:15 AM
  6. convert military time to regular hours
    By Kathy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2006, 08:25 AM
  7. Problem with Long Calculation Time
    By albanshere in forum Excel General
    Replies: 2
    Last Post: 04-18-2005, 03:53 AM
  8. Time Calculation - How long a macro takes to run
    By cdb in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-31-2005, 04:06 AM

Tags for this Thread

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