Formula for selecting 3 consecutive occurrences.

championbowler

New Member
Joined
May 1, 2024
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
Can someone please explain to me what formula is needed to acheive the below highlighted cells when there is 3 consecutive entries in the us or the them column. Any help would be greatly appreciated
 

Attachments

  • Screenshot 2024-05-01 230731.png
    Screenshot 2024-05-01 230731.png
    10.2 KB · Views: 14

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi, welcome to the forum.

I think we might need a little more explanation to your problem. As the "End" column appears to just be a list of consecutive numbers ?

When you say 3 consecutive entries in US or THEM, if I look at ends 8-14, do you mean each row (eg. Them = 5, Them = 1, US = 1) so that would constitute three consecutive entries ?

Are the "End" columns blank until you get 3 entries, then you add another one ? (so you're just adding +1 to the one above ?

any clarifications might help us understand your need... do you talk about Red or Green highlights .. ?

cheers
Rob
 
Upvote 0
Can someone please explain to me what formula is needed to acheive the below highlighted cells when there is 3 consecutive entries in the us or the them column. Any help would be greatly appreciated
Thanks for replying so effectively i will have 2 formulas one for the us column where there is an entry of a number of 3 or more times i want this to be filled green as per example and the other will be the exact same argument but for the them column filled in red. I hope this clarifes.
 
Upvote 0
I see, so you actually want to "colour" or actually Highlight the cells, rather than change data inside (sorry, I missed that from your original post). As far as I know there's no formula as such to achieve what you need, sorry.

Closest I I would suggest perhaps a TOTAL US and TOTAL THEM cell be added at the bottom of your list, with a COUNTA to give a total. Then conditional format each total based on the other.
Not really what you want to achieve .. but some kind of highlight

Book1
JKL
1ENDS 15 - 21
2
3ENDlJSTHEM
4153
5162
6173
7181
8191
9203
10212
11
12TOTALTOTAL
1343
14
Sheet1
Cell Formulas
RangeFormula
K13:L13K13=COUNTA(K4:K10)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
L13Cell Value>$K$13textNO
K13Cell Value>$L$13textNO
 
Upvote 0
I see, so you actually want to "colour" or actually Highlight the cells, rather than change data inside (sorry, I missed that from your original post). As far as I know there's no formula as such to achieve what you need, sorry.

Closest I I would suggest perhaps a TOTAL US and TOTAL THEM cell be added at the bottom of your list, with a COUNTA to give a total. Then conditional format each total based on the other.
Not really what you want to achieve .. but some kind of highlight

Book1
JKL
1ENDS 15 - 21
2
3ENDlJSTHEM
4153
5162
6173
7181
8191
9203
10212
11
12TOTALTOTAL
1343
14
Sheet1
Cell Formulas
RangeFormula
K13:L13K13=COUNTA(K4:K10)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
L13Cell Value>$K$13textNO
K13Cell Value>$L$13textNO
Thanks ill have a look into it appreciate your time.
 
Upvote 0
How about:

Book1
ABCDEFGHIJK
1ENDS 1 - 7ENDS 8 - 14ENDS 15 - 21
2ENDUSTHEMENDUSTHEMENDUSTHEM
31185153
42291162
532101173
642113181
751121191
864132203
971142212
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K3:K9Expression=MAX(COUNT(K1:K3),COUNT(K2:K4),COUNT(K3:K5))>2textNO
G3:G9Expression=MAX(COUNT(G1:G3),COUNT(G2:G4),COUNT(G3:G5))>2textNO
C3:C9Expression=MAX(COUNT(C1:C3),COUNT(C2:C4),COUNT(C3:C5))>2textNO
B3:B9Expression=MAX(COUNT(B1:B3),COUNT(B2:B4),COUNT(B3:B5))>2textNO
F3:F9Expression=MAX(COUNT(F1:F3),COUNT(F2:F4),COUNT(F3:F5))>2textNO
J3:J9Expression=MAX(COUNT(J1:J3),COUNT(J2:J4),COUNT(J3:J5))>2textNO
 
Upvote 0
How about:

Book1
ABCDEFGHIJK
1ENDS 1 - 7ENDS 8 - 14ENDS 15 - 21
2ENDUSTHEMENDUSTHEMENDUSTHEM
31185153
42291162
532101173
642113181
751121191
864132203
971142212
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K3:K9Expression=MAX(COUNT(K1:K3),COUNT(K2:K4),COUNT(K3:K5))>2textNO
G3:G9Expression=MAX(COUNT(G1:G3),COUNT(G2:G4),COUNT(G3:G5))>2textNO
C3:C9Expression=MAX(COUNT(C1:C3),COUNT(C2:C4),COUNT(C3:C5))>2textNO
B3:B9Expression=MAX(COUNT(B1:B3),COUNT(B2:B4),COUNT(B3:B5))>2textNO
F3:F9Expression=MAX(COUNT(F1:F3),COUNT(F2:F4),COUNT(F3:F5))>2textNO
J3:J9Expression=MAX(COUNT(J1:J3),COUNT(J2:J4),COUNT(J3:J5))>2textNO
Ill give this a try thank you for taking the time to help
 
Upvote 0

Forum statistics

Threads
1,216,043
Messages
6,128,470
Members
449,455
Latest member
jesski

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