+ Reply to Thread
Results 1 to 6 of 6

Countif performance drain on big data set

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Countif performance drain on big data set

    I have a data set with over 120.000 lines.

    In that set I want to use VBA to make a formula.
    The formula multiplies 3 rows with eachtother. That outcome than gets divided by a fixed number.

    So far so good formula runs fine even on that many lines.

    However in that set that are some lines that get couted double in the formula.
    Throwing out these lines is not an option as other columns of that line are needed.

    So being smart I thought then I just let the macro count how often a certain number occurs in one of the columns.
    Then I take my original formula and divide that by the outcome of the countif formula (most will be 1, and some are 2 or 3 and then the outcome of the formula is good again).

    But damn what a huge difference with the original formula!
    I could not even wait for it to end because 1% progress takes really minutes and my laptop is ready for take off! (and it is really not a slow laptop).

    Is there a more efficient and better way then countif to identify how often a certain number in a column occurs?

    ps: Manually I took out the column for the countif and ran it in a separate workbook/sheet.
    That is faster but then I need to work with a vlookup again which maybe also is not desirable.

  2. #2
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Countif performance drain on big data set

    Ok maybe text only is a bit too abstract

    I attached a sample book.
    Only 4 columns and due to size limit of the file only 43.000 lines but still a big performance drain using the countif.
    On the original file it will even be 3 times as slow...

    Anybody who can speed the formula up?
    (and ofcourse using VBA to copy it down efficient).
    Attached Files Attached Files

  3. #3
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Countif performance drain on big data set

    This macro will create the countif values on column G :
    Please Login or Register  to view this content.
    then you can change the formula on E2 to :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  4. #4
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Countif performance drain on big data set



    That is very impressive karedog!
    The speed (on the example) is great.

    Coding is way above my comprehension (doesn't look like a countif to me )but it does the trick.
    Thank you very much!

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Countif performance drain on big data set

    You are welcome rpinxt, thanks for marking the thread as solved and rep.points.

    Regards

  6. #6
    Registered User
    Join Date
    12-17-2015
    Location
    Pollachi,India
    MS-Off Ver
    Office 2016
    Posts
    1

    Re: Countif performance drain on big data set

    Very Helpful, thanks Karedog.
    Any thoughts on implementing it for Countifs.

+ 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] Performance data
    By wanmuhd in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-10-2016, 04:01 AM
  2. current moth MTD performance with last year same month same days performance
    By satyanarayana in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-03-2015, 03:36 AM
  3. [SOLVED] pull data based on task name and performance
    By greggatz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2014, 01:25 PM
  4. Excel 2007 : Performance using COUNTIF
    By binster in forum Excel General
    Replies: 1
    Last Post: 11-24-2009, 11:40 AM
  5. Poor Array Performance, COUNTIF
    By nine7 in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 03-04-2009, 01:03 PM
  6. Large data....slow excel performance..!!
    By Aryaa Dixit in forum Excel General
    Replies: 9
    Last Post: 01-07-2009, 03:39 AM
  7. Counting for two criteria - brain drain
    By seve in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-23-2005, 08:06 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