ConditionalF in table too slow. Other solution?

Weeble

Board Regular
Joined
Nov 30, 2016
Messages
95
Office Version
  1. 365
I have a table where column C are dates and column E are names.
I have a conditional formatting rule that checks for duplicates.. If date and name are duplicate, highlight red. My problem is that since I am using a table I can't specify a range ( excel don't support that yet? ) And right now I am at 12000 rows. When I want to filter it takes forever for excel.
Could I possibly use VBA to to the same thing but in a table range?

For example. VBA
IF Table1 updates
CHECK IF C and F = Duplicates
IF true = Highlight C to F
If false = break
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Whilst you cannot use table references in CF rules, if you select the table range when applying the rule, the range will automatically update if the table changes in size.
 
Upvote 0
This is how I do it using CF which restricts all ranges to the size of the table
I find it easier to use named ranges which automatically expand or contract with a table

Create 2 named ranges

T_Dates
with refers to range
=Table1[Date]

T_Names with refers to range
=Table1[Name]

Select data (not header) in chosen columns (I only selected column C and then E)

Create CF rule with formula
=COUNTIFS(T_Dates,C2,T_Names,E2)>1

Results

cf110.jpg



Book1
ABCDEFG
1H1H2DateH4NameH6H7
2Data1Data201/10/2020Data4JoeData6Data7
3Data1Data202/10/2020Data4JackData6Data7
4Data1Data203/10/2020Data4JillData6Data7
5Data1Data204/10/2020Data4JennyData6Data7
6Data1Data205/10/2020Data4JasonData6Data7
7Data1Data201/10/2020Data4JoeData6Data7
8Data1Data207/10/2020Data4JackData6Data7
9Data1Data208/10/2020Data4JillData6Data7
10Data1Data204/10/2020Data4JennyData6Data7
11Data1Data215/10/2020Data4JasonData6Data7
12Data1Data201/10/2020Data4JoeData6Data7
13Data1Data217/10/2020Data4JackData6Data7
14Data1Data218/10/2020Data4JillData6Data7
15Data1Data219/10/2020Data4JennyData6Data7
16Data1Data220/10/2020Data4JasonData6Data7
17Data1Data201/10/2020Data4JoeData6Data7
18Data1Data222/10/2020Data4JackData6Data7
19Data1Data223/10/2020Data4JillData6Data7
20Data1Data224/10/2020Data4JennyData6Data7
21Data1Data201/10/2020Data4JasonData6Data7
22Data1Data201/10/2020data4joeData6Data7
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E22Expression=COUNTIFS(T_Dates,C2,T_Names,E2)>1textNO
C2:C22Expression=COUNTIFS(T_Dates,C2,T_Names,E2)>1textNO
 
Last edited:
Upvote 0
There's no need to use named ranges, as long as you originally set the applies to range to match the databody range ( either one column or multiple columns) the appliesto range will automatically change to match the size of the table.
 
Upvote 0
@Fluff - agreed :) but old habits die hard ;) and the CF formula is simplified and immediately understandable
=COUNTIFS(T_Dates,C2,T_Names,E2)>1

My suggestion also selects the data in the table to determine the CF range
 
Upvote 0
Whilst you cannot use table references in CF rules, if you select the table range when applying the rule, the range will automatically update if the table changes in size.

Ah, thank you. Useful to know in the future. :)

I was able to scale it down then to 12k rows. But my file is still extremly slow. If I try to filter excel will think about the process for a good minute before anything happends.
Might be my CF formula that makes it slow?
XML:
=SUMPRODUCT(($C$2:$C$27830=$C2)*($E$2:$E$27830=$E2))>1
 
Upvote 0
You can limit the formula to the range of the table as well & it will change automatically.
You can also use
Excel Formula:
=COUNTIFS($C$2:$C$8790,$C2,$E$2:$E$8790,$E2)>1
However it will still be slow.
Are the values in C & E manually entered or are they formulae?
 
Upvote 0
You can limit the formula to the range of the table as well & it will change automatically.
You can also use
Excel Formula:
=COUNTIFS($C$2:$C$8790,$C2,$E$2:$E$8790,$E2)>1
However it will still be slow.
Are the values in C & E manually entered or are they formulae?

There are no other formulas in the table. They are connected thrue a powerquery.
So i'm guessing as long as I use a CF on this kind of size, it will be slow?

Any other ideas on how I might be able to to do it?
 
Upvote 0
If the table is created with Power Query, then I don't know if there is another way of doing it, as I've never used PQ.
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top