Hightlight based on duplicates AND a certain value

%3CLINGO-SUB%20id%3D%22lingo-sub-3333977%22%20slang%3D%22en-US%22%3EHightlight%20based%20on%20duplicates%20AND%20a%20certain%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3333977%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20have%20a%20spreadsheet%20which%20has%20duplicated%20values%20in%20column%20B.%26nbsp%3B%20I%20want%20excel%20to%20look%20at%20the%20duplicates%20in%20column%20b%20and%20then%20for%20rows%20which%20have%20the%20same%2C%20duplicated%20entry%20in%20column%20B.%20I%20want%20it%20to%20ALSO%20look%20for%20a%20specific%20number%20in%20coumn%20F.%26nbsp%3B%20If%20excel%20finds%20the%20specified%20number%20in%20column%20F%20I%20want%20it%20to%20highlight%20both%20rows%20with%20the%20duplicated%20figure%20in%20column%20B.%26nbsp%3B%20So%20this%20would%20be%20an%20example%3A%20column%20B%20has%20the%20same%20value%2C%20its%20also%20looking%20for%20the%20number%201154798451%20(in%20column%20F)%20and%20it%20finds%20that%20so%20highlights%20both%20rows%20that%20have%20the%20duplicated%20value%20in%20column%20B%2C%20anyone%20know%20if%20such%20a%20thing%20is%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Salz15_1-1651851433773.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369863iAB457FEE7440605E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Salz15_1-1651851433773.png%22%20alt%3D%22Salz15_1-1651851433773.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3333977%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3334610%22%20slang%3D%22en-US%22%3ERe%3A%20Hightlight%20based%20on%20duplicates%20AND%20a%20certain%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3334610%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3EThis%20is%20great%20thanks%2C%20I%20was%20almost%20there%20with%20it%20but%20not%20quite.%26nbsp%3B%20Unfortunately%20the%20file%20has%20328000%20rows%20and%20and%20this%20this%20is%20too%20much%20for%20it.%26nbsp%3B%20It%20crashes%20when%20I%20try%20and%20put%20the%20formular%20in.%26nbsp%3B%20Thanks%20for%20your%20help%20anyway.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3334661%22%20slang%3D%22en-US%22%3ERe%3A%20Hightlight%20based%20on%20duplicates%20AND%20a%20certain%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3334661%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1383078%22%20target%3D%22_blank%22%3E%40Salz15%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you're%20willing%20to%20use%20a%20helper%20column%2C%20that%20should%20avoid%20crashing.%3C%2FP%3E%0A%3CP%3EEnter%20the%20formula%20in%20a%20free%20cell%20in%20row%201.%20I'll%20use%20G1%20as%20example%2C%20but%20any%20other%20column%20is%20fine%20too.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DAND(COUNTIF(%24B%241%3A%24B%2432800%2C%24B1)%26gt%3B1%2CCOUNTIFS(%24B%241%3A%24B%2432800%2C%24B1%2C%24F%241%3A%24F%2432800%2C1154798451)%26gt%3B0)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EChange%20the%20ranges%20if%20necessary%2C%20then%20fill%20down%20to%20row%2032800%20(or%20to%20the%20end%20of%20the%20data).%3C%2FP%3E%0A%3CP%3ECreate%20a%20conditional%20formatting%20rule%20as%20in%20my%20previous%20reply%2C%20but%20with%20the%20formula%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3D%24G1%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3334146%22%20slang%3D%22en-US%22%3ERe%3A%20Hightlight%20based%20on%20duplicates%20AND%20a%20certain%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3334146%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1383078%22%20target%3D%22_blank%22%3E%40Salz15%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESelect%20the%20range%20in%20columns%20A%20to%20F%20that%20you%20want%20to%20format.%3C%2FP%3E%0A%3CP%3EI%20will%20assume%20that%20the%20active%20cell%20in%20the%20selection%20is%20in%20row%201.%3C%2FP%3E%0A%3CP%3EOn%20the%20Home%20tab%20of%20the%20ribbon%2C%20click%20Conditional%20Formatting%26gt%3B%20New%20Rule...%3C%2FP%3E%0A%3CP%3ESelect%20'Use%20a%20formula%20to%20determine%20which%20cells%20to%20format'.%3C%2FP%3E%0A%3CP%3EEnter%20the%20formula%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DAND(COUNTIF(%24B%241%3A%24B%24100%2C%24B1)%26gt%3B1%2CCOUNTIFS(%24B%241%3A%24B%24100%2C%24B1%2C%24F%241%3A%24F%24100%2C1154798451)%26gt%3B0)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EClick%20Format...%3C%2FP%3E%0A%3CP%3EActivate%20the%20Fill%20tab.%3C%2FP%3E%0A%3CP%3ESelect%20a%20color.%3C%2FP%3E%0A%3CP%3EClick%20OK%2C%20then%20click%20OK%20again.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi, I have a spreadsheet which has duplicated values in column B.  I want excel to look at the duplicates in column b and then for rows which have the same, duplicated entry in column B. I want it to ALSO look for a specific number in coumn F.  If excel finds the specified number in column F I want it to highlight both rows with the duplicated figure in column B.  So this would be an example: column B has the same value, its also looking for the number 1154798451 (in column F) and it finds that so highlights both rows that have the duplicated value in column B, anyone know if such a thing is possible?

 

Salz15_1-1651851433773.png

 

 

 

 

3 Replies

@Salz15 

Select the range in columns A to F that you want to format.

I will assume that the active cell in the selection is in row 1.

On the Home tab of the ribbon, click Conditional Formatting> New Rule...

Select 'Use a formula to determine which cells to format'.

Enter the formula

 

=AND(COUNTIF($B$1:$B$100,$B1)>1,COUNTIFS($B$1:$B$100,$B1,$F$1:$F$100,1154798451)>0)

 

Click Format...

Activate the Fill tab.

Select a color.

Click OK, then click OK again.

@Hans VogelaarThis is great thanks, I was almost there with it but not quite.  Unfortunately the file has 328000 rows and and this this is too much for it.  It crashes when I try and put the formular in.  Thanks for your help anyway.

@Salz15 

If you're willing to use a helper column, that should avoid crashing.

Enter the formula in a free cell in row 1. I'll use G1 as example, but any other column is fine too.

 

=AND(COUNTIF($B$1:$B$32800,$B1)>1,COUNTIFS($B$1:$B$32800,$B1,$F$1:$F$32800,1154798451)>0)

 

Change the ranges if necessary, then fill down to row 32800 (or to the end of the data).

Create a conditional formatting rule as in my previous reply, but with the formula

 

=$G1