+ Reply to Thread
Results 1 to 8 of 8

How can I make this array formula (see thread) less computationally demanding?

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    How can I make this array formula (see thread) less computationally demanding?

    Hi all again! (Still working on aspects of the FDA adverse events database)
    I wish to find the Patient ID (ISR) that occurs in a list (only 2 columns).
    The following array formula that I came up with:

    { =COUNTIF(A2:A1000,INDEX(A2:1000,MATCH(MAX(COUNTIF(A2:1000,A2:A1000)),COUNTIF(A2:A1000,A2:A1000),0))) }

    works a treat on a list/file with around 1000 rows, however the files I am playing with have around 300,000 rows and it takes far too long (not bothered to try to wait - gave up after 10 mins).

    I am sure there must be a much more computationally elegant and less resource intense way of performing the same calculation - Likely VB?. - Please suggest.

    Attached is a sample of the first 1000 rows for testing.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How can I make this array formula (see thread) less computationally demanding?

    Maybe pivot table and sort from high to low.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    07-08-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How can I make this array formula (see thread) less computationally demanding?

    Thanks oeldere. I have to admit that I have not used pivot tables much in the past, looks like this will be a good chance for me to learn. Thank you for your valued input!

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: How can I make this array formula (see thread) less computationally demanding?

    Thanks for the reply.

    Glad I could help.

  5. #5
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: How can I make this array formula (see thread) less computationally demanding?

    Hi
    I have just played around with your sample and tried it with over half a million rows and it works fine. The only thing I changed was to sort the data by Column A. It took about three seconds.
    On that basis make sure your data is sorted by Column A and give that a go.
    Good luck.
    Tony

  6. #6
    Registered User
    Join Date
    07-08-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How can I make this array formula (see thread) less computationally demanding?

    Thanks ARGK,
    One question, what do you mean by "sorted by column A"?

  7. #7
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: How can I make this array formula (see thread) less computationally demanding?

    Hi
    You need to sort all of your data based on the values in Column A. So highlight all your data and click on sort (click on the A to Z button and by default it should sort by the first column in the range, which in your case will be column A.
    Tony

  8. #8
    Registered User
    Join Date
    07-08-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: How can I make this array formula (see thread) less computationally demanding?

    Thanks ARGK,
    I agree the sorting is required, and have always sorted the data prior to processing for that exact reason (have been using $LOOKUP functions a bit lately). I was hoping that there was something else that I may have missed, but it appears that my computer is just too slow. This time I let it run for nearly an hour without completion. Definitely not going to sort though another 40+ files this size using my array formula.
    Thanks for the help all the same.
    Dexamphetamine

+ 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] Make it easier to save a thread so you can find it later
    By BroJoe in forum Suggestions for Improvement
    Replies: 6
    Last Post: 01-24-2013, 02:01 AM
  2. Thread Subject: Filling Excel Cells from Array of MatLab Builder EX
    By tikrit in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-15-2012, 12:52 AM
  3. [SOLVED] How to make an array of workbooks made up of an array of worksheets?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2012, 08:33 AM
  4. [SOLVED] Improvement - make marking a thread Solved a lot easier!
    By OnErrorGoto0 in forum Suggestions for Improvement
    Replies: 7
    Last Post: 03-27-2012, 02:37 AM
  5. Make a Date variable equal a single-cell array formula
    By Shamala in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2012, 06:29 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