+ Reply to Thread
Results 1 to 12 of 12

Problem in Conditional Formatting making Excel Slow.

  1. #1
    Forum Contributor
    Join Date
    12-01-2013
    Location
    Saudi
    MS-Off Ver
    Excel 2007
    Posts
    103

    Problem in Conditional Formatting making Excel Slow.

    hi everyone

    I need some help regarding the conditional formatting my excel is running slow. Here is the formula: =AND(COUNTIF($B:$B,$B14)=COUNTIF($B$14:$B14,$B14),$O14="P")

    anyone have advise or another formula.

    Thanks in advance!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,974

    Re: Problem in Conditional Formatting making Excel Slow.

    Limit this range:

    $B:$B
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Problem in Conditional Formatting making Excel Slow.

    Hi,

    I would think that if you can sort the data on column B, you could use a more efficient formula. If not, you should probably separate the two tests using
    =IF($O14="P",COUNTIF($B:$B,$B14)=COUNTIF($B$14:$B14,$B14),FALSE)
    so that the COUNTIF part is only executed if column O contains P.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Problem in Conditional Formatting making Excel Slow.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Mentioned actual data range. For example $B$2:$B$200
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Problem in Conditional Formatting making Excel Slow.

    In my experience there is little to no benefit to be had by limiting the range passed to COUNTIF as it only looks at the used range anyway.

  6. #6
    Forum Contributor
    Join Date
    12-01-2013
    Location
    Saudi
    MS-Off Ver
    Excel 2007
    Posts
    103

    Re: Problem in Conditional Formatting making Excel Slow.

    thanks for the reply

    xlnitwit thank you very much now its solved my problem..

  7. #7
    Forum Contributor
    Join Date
    12-01-2013
    Location
    Saudi
    MS-Off Ver
    Excel 2007
    Posts
    103

    Re: Problem in Conditional Formatting making Excel Slow.

    thank you all for your response.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,974

    Re: Problem in Conditional Formatting making Excel Slow.

    Quote Originally Posted by xlnitwit View Post
    In my experience there is little to no benefit to be had by limiting the range passed to COUNTIF as it only looks at the used range anyway.
    Genuine question, as I really don't know the answer: how does it know what the used range is without looking at the entire array if the whole column is referenced in the formula?
    Last edited by AliGW; 07-03-2017 at 05:11 AM.

  9. #9
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Problem in Conditional Formatting making Excel Slow.

    I don't know, is the simple answer but I have never seen much performance difference when passing entire columns to most worksheet functions. There is an obvious hit if you use an operator on an entire column (like * or / for example) but worksheet functions themselves seem to have some sort of short-circuiting to limit the range they consider, whether that be in the function code itself or in the way that the range is passed to the function.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,974

    Re: Problem in Conditional Formatting making Excel Slow.

    Thanks. Nonetheless, it is well-known that some formulae that reference entire columns are slower than the same formulae with a limited range. Seems to be a problem with some array formulae.

  11. #11
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Problem in Conditional Formatting making Excel Slow.

    Yes that is certainly true. Many array formulas use operators on arrays, which are affected by entire columns, but also I think the array nature of the formula leads to multiple evaluations dependent upon the number of input cells, and this, I think, bypasses the short-circuiting feature.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,974

    Re: Problem in Conditional Formatting making Excel Slow.

    I'm sure you're right. All very interesting.

+ 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] Conditional formatting making spreadsheet slow
    By carrod65 in forum Excel General
    Replies: 8
    Last Post: 02-22-2017, 05:02 PM
  2. sumif making excel run slow
    By stephme55 in forum Excel General
    Replies: 4
    Last Post: 07-14-2016, 01:18 PM
  3. Macro making Excel unworkably slow
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2015, 10:53 AM
  4. Slow conditional formatting
    By leprince2007 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-23-2015, 07:10 AM
  5. Replies: 0
    Last Post: 09-20-2013, 11:15 AM
  6. Replies: 17
    Last Post: 03-22-2013, 09:22 AM
  7. Replies: 3
    Last Post: 04-17-2012, 11:15 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