Highlighting every 6th occurence in a table using conditional formatting

PIRC13

New Member
Joined
Jul 25, 2013
Messages
25
I have a spreadsheet which is used to add in the vacancies which are closed. As you can see there is a reference number, a date and the title of the vacancy. I want to highlight every 6th occurence of the Administrator vacancy for the records to be audited. I want all fields in the record to be highlighted in a colour, however the importance is that although these are added in no particular sequence, every sixth record for administrator, no matter the date, are to be highlighted.

Ref NoDateTitle
19/00102-FebAdministrator
19/00209-FebPlumber
19/00310-FebAdministrator
19/00426-FebAdministrator
19/00501-MarBuilder
19/00602-MarBaker
19/00704-MarEngineer
19/00808-MarAdministrator
19/00912-MarAdministrator
19/01015-MarAdministrator
19/01117-MarBuilder
19/01221-MarPlumber
19/01302-AprBuilder
19/01403-AprAdministrator
19/01504-AprEngineer
19/01604-AprAdministrator
19/01706-AprAdministrator
19/01807-AprTeacher
19/01910-AprAccountant
19/02011-AprEngineer
19/02111-AprEngineer
19/02211-AprAdministrator
19/02312-AprTeacher
19/02415-AprAdministrator
19/02515-AprAdministrator

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Select all data (not the headers), say, A2:C100

In Conditional Formatting use this formula
=AND($C2="Administrator",MOD(COUNTIF($C$2:$C2,$C2),6)=0)

Pick the format you want

M.
 
Last edited:
Upvote 0
Hey,

I know you can do it via VBA if that helps:

Code:
Sub HighlightSixthAdmin()
    Dim txt As String
    Dim incrementor As Integer
    Dim rng As Range
    Dim cell As Range
    Set rng = Range("Table1[Title]")
    txt = "Administrator"
        For Each cell In rng
            If cell.Value = txt Then
                incrementor = incrementor + 1
                    If incrementor Mod 6 = 0 Then
                        cell.Interior.ColorIndex = 36
                    End If
            End If
        Next cell
End Sub

I'll look in to doing it with CF though!
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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