+ Reply to Thread
Results 1 to 20 of 20

Splitting excel array formula due to huge data amount

  1. #1
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Splitting excel array formula due to huge data amount

    Hi Experts,

    I previously have a formula given here that is an array formula as below where it checks if a cell detail is within 24 hours of each other but the problem is I am working with a huge data of almost 1mil rows and even for 10k lines it takes about 40mins for this formula to run.
    Can anyone advice if this is something I can split the formula into or a different or better way to do it?
    Attaching the sample result file.

    {=SUMPRODUCT((ABS($D$2:$D$995887-D2)<1)*($C$2:$C$995887=C2))>1}


    Kind Regards,
    Mark.
    Attached Files Attached Files

  2. #2
    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,193

    Re: Splitting excel array formula due to huge data amount

    Would a VBA solution be acceptable? If so, can you post a larger file( against normal practice on the forum I know!) so I can get a measure of performance.

    And can the data be sorted by Name and Opened time?

    A test of 960,000 rows took a few seconds.

    Thank you.
    Last edited by JohnTopley; 05-18-2021 at 12:09 PM.

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

    Re: Splitting excel array formula due to huge data amount

    Pl see file.
    Here is the code for UDF. This works faster. Pl try.
    Let me know any problem. If works ok Pl tell the time difference.
    Please Login or Register  to view this content.
    UDF

    How to Use UDF code:
    In the developer tab click--> Visual Basic
    VB window opens
    Insert--> Module
    Paste the code.
    Close the VB window.
    Now UDF is available in Function List
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Splitting excel array formula due to huge data amount

    Try

    =COUNTIFS(B:B,B2,C:C,"<"&C2+1,C:C,">"&C2-1)>1
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    Hi JohnTopley,

    Would you be so kind to share the VBA code and I can run it from my end.
    I tried the below solutions from kvsrinivasamurthy and Bo_ry and both works but took me 4 hours to run it but if you have something which takes seconds I am very much interested. :-)

    Kind Regards,
    MArk,

  6. #6
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    Thanks Bo_ry and kvsrinivasamurthy really appreciate your help both of the formula works but it took hours to process 1million rows of data which I assume would be normal.
    Hopefully JohnTopley has something which can help to reduce the time.

    Kind Regards,
    MArk.

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

    Re: Splitting excel array formula due to huge data amount

    Please Login or Register  to view this content.
    The data is sorted by name then Opened Time

    Sheet2 of the attached has the 96,000 rows (purely a volume test). Click RUN to run macro.

    I have run it with 960,000 rows (too big to upload!)

    VBA assumes data as per sheet2.

    Ensure you headings in A:D of row 1
    Attached Files Attached Files
    Last edited by JohnTopley; 05-18-2021 at 03:19 PM.

  8. #8
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    Hi JohnTopley,

    I tried with my data and it gave an error. I assume could it be because I have spaces and characters as well?
    Attaching the file with 10k lines which I used. Tried to show more data but it went over the 1MB limit. :-(

    Kind Regards,
    MArk.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    It actually ran successfully now but it changed some of the values in column B.
    Ran it again and it failed.
    Last edited by mark888; 05-18-2021 at 03:44 PM.

  10. #10
    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,193

    Re: Splitting excel array formula due to huge data amount

    Ensure you headings in A:D of row 1
    I don't think you followed the above!

    See Sheet3
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    Hi JohnTopley,

    Yes I see sheet3 but the data in column B has changed from the original file. Did it overwrite the data with something else or am I wrongly following what you meant.
    Apologize If I cant understand. I did the same just pasted the data from A2 onwards.

    Kind Regards,
    MArk.

  12. #12
    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,193

    Re: Splitting excel array formula due to huge data amount

    I explained that the data is SORTED by Name and the Opened Time to minimise the computation time.

    You did not indicate this was unacceptable. The data can be "Unsorted" by numbering each row prior to the initial sort, do the computation then re-sort on the original row numbers.

    I will be signing off now as its late evening here in the UK. I'll look again in the morning.

  13. #13
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    Ahh ok understood now, thanks for looking into this and wish you a good evening. :-)

    Kind Regards,
    Mark.

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

    Re: Splitting excel array formula due to huge data amount

    Here is macro code. Pl try
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 05-19-2021 at 12:47 AM.

  15. #15
    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,193

    Re: Splitting excel array formula due to huge data amount

    Please Login or Register  to view this content.
    Added column E which allows the data to be resorted (routine "Unsort")to its original sequence after the computation.

    PLEASE ensure you have headings in columns A:E in row1 as in Sheet3
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    This is perfect, many thanks again for your help JohnTopley and most importantly your time. :-)

    Kind Regards,
    MArk.

  17. #17
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    Thanks kvsrinivasamurthy, this one also works so now I have 2 ways, appreciate it. :-)

  18. #18
    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,193

    Re: Splitting excel array formula due to huge data amount

    Curiosity ... how long did it take to process your file?

  19. #19
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: Splitting excel array formula due to huge data amount

    It took me 3.6mins with kvsrinivasamurthy macro and yours took about 35seconds.
    Thats a great reduction from my original array formula which took 6 hours for 300k lines. I only wish I could treat you a beer!

    Kind Regards,
    Mark.

  20. #20
    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,193

    Re: Splitting excel array formula due to huge data amount

    Thank you for the feedback.

    You're very welcome: I'll have "virtual" beer on you!

    Regards,

    John

+ 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. Issues with huge amount of data
    By maroni in forum Excel General
    Replies: 2
    Last Post: 02-02-2016, 06:44 AM
  2. Splitting two huge DBF to smaller Excel files
    By ferferi in forum Access Tables & Databases
    Replies: 1
    Last Post: 06-12-2015, 11:11 AM
  3. Mark Pass/Fail Using Vba for the Huge amount of data
    By laxmanann in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 12-16-2014, 03:36 PM
  4. [SOLVED] macro / code to create pivot on huge amount of data
    By Bax in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-16-2014, 03:25 AM
  5. !! Help with huge amount of data - allocation
    By mariosmk555 in forum Excel General
    Replies: 3
    Last Post: 03-23-2014, 02:32 PM
  6. Extracting Top 10 Customers from Huge Amount of Data
    By Susan Schneider in forum Excel General
    Replies: 24
    Last Post: 04-12-2013, 08:42 PM
  7. Replies: 5
    Last Post: 08-09-2011, 09:43 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