Highlight consecutive(sequential) numbers in excel

Samgraphics

Board Regular
Joined
Jan 9, 2022
Messages
61
Office Version
  1. 2011
Platform
  1. MacOS
Hi, can someone please help me? I'm trying to highlight combinations of numbers if they increase incrementally, example 1,2,3,4,5 or combination where the interval is increasing at the same rate like 5,12,20,29,39 or combinations with equal intervals like 2,4,6,8,10. So any combinations like the ones I highlighted below would be highlighted.

Thank you in advance

All combinations 2023-24.xlsm
CDEFG
112345
212346
312347
412348
512349
6246810
DA LUO TO
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=IF(AND(C1=D1-1, D1=E1-1, E1=F1-1, F1=G1-1), "Consecutive", "Not Consecutive")textNO
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Could this work for you?

23 12 17.xlsm
CDEFG
112345
212346
312347
412348
512349
6246810
Consistent Change
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:G6Expression=MIN($D1:$G1-$C1:$F1)=MAX($D1:$G1-$C1:$F1)textNO
 
Upvote 0
Could this work for you?

23 12 17.xlsm
CDEFG
112345
212346
312347
412348
512349
6246810
Consistent Change
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:G6Expression=MIN($D1:$G1-$C1:$F1)=MAX($D1:$G1-$C1:$F1)textNO
HI, Thank you so much. This works fine for combinations that increase incrementally. Can you explain how it works or me please? Also is there one that can highlight it if it increases at the same rate?
 
Upvote 0
Can you explain how it works or me please?
The formula works out the difference between every pair of consecutive cells. For row 6 it works out
4-2=2
6-4=2
8-6=2
10-8=2

The formula then compares the smallest of those 4 answers (2) and the largest of those 4 answers (2) and if they are the same as each other (they are) then there is a consistent difference so highlight.

Also is there one that can highlight it if it increases at the same rate?
Like this?

23 12 17.xlsm
CDEFG
1512202939
2510162330
3310203349
Consistent Increase
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:G3Expression=MIN(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))=MAX(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))textNO
 
Upvote 1
Really thank you very much for your help.
The formula works out the difference between every pair of consecutive cells. For row 6 it works out
4-2=2
6-4=2
8-6=2
10-8=2

The formula then compares the smallest of those 4 answers (2) and the largest of those 4 answers (2) and if they are the same as each other (they are) then there is a consistent difference so highlight.


Like this?

23 12 17.xlsm
CDEFG
1512202939
2510162330
3310203349
Consistent Increase
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:G3Expression=MIN(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))=MAX(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))textNO
 
Upvote 0
Currently I'm using this formula to check if a previously drawn number is in the group,the countifs, but it's long and it's really slowing down excel. Is there another way to do it? A less cumbersome way?

All combinations 2023-24.xlsm
CDEFGHIJKLMN
112345123430
212346920232933
312347413151732
412348422253031
5123491291930
61234101516253134
7123411712202831
8123412419213031
91234131323273034
10123414518222829
111234151015222733
121234161018252833
1312341734121523
1412341837212224
151234191320272930
16123420923252733
171234211571213
181234224781819
19123423712172634
20123424725262932
21123425618232732
22123426214162830
231234271792529
24123428511152333
2512342928163134
2612343048101421
DA LUO TO
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:G98280Expression=COUNTIFS($J$1:$J$98280,$C1,$K$1:$K$98280,$D1,$L$1:$L$98280,$E1,$M$1:$M$98280,$F1,$N$1:$N$98280,$G1)textNO
C1:G98280Expression=MIN($D1:$G1-$C1:$F1)=MAX($D1:$G1-$C1:$F1)textNO
C1:G98280Expression=MIN(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))=MAX(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))textNO


Thank you.
 
Upvote 0
The formula works out the difference between every pair of consecutive cells. For row 6 it works out
4-2=2
6-4=2
8-6=2
10-8=2

The formula then compares the smallest of those 4 answers (2) and the largest of those 4 answers (2) and if they are the same as each other (they are) then there is a consistent difference so highlight.


Like this?

23 12 17.xlsm
CDEFG
1512202939
2510162330
3310203349
Consistent Increase
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:G3Expression=MIN(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))=MAX(($E1:$G1-$D1:$F1)-($D1:$F1-$C1:$E1))textNO
Hi, is there any way to modify this to find 3 consecutive numbers in any position? For example 1,2,3 or 2,3,4 or 3,4,5?

Thank you.
 
Upvote 0
Please be careful with your 'quotes' and only quote relevant posts or parts of them. I have just removed three quotes from your last post that, as far as I can see, had nothing to do with this follow-up question.

Hi, is there any way to modify this to find 3 consecutive numbers in any position? For example 1,2,3 or 2,3,4 or 3,4,5?
Could you give some sample data and expected results with XL2BB so that we can see what range(s) you are working with and how you would want the results presented? Make sure that there are some examples where there are 3 (or more?) consecutive numbers and some examples where there are no sets of 3 consecutive numbers.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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