CF for Top 4 Consecutive Values

gannybun

New Member
Joined
Dec 10, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
ABCDEFGHIJKLTOP 4 Consecutive (SUM)
202060901020202050505050200

Sum of Top 4 Consecutive, the formula i am using is =SUMPRODUCT(MAX(A2:I2+B2:J2+C2:K2+D2:L2))


I am trying to do Conditional Formatting to highlight the cells, that have the top 4 consecutive value but i am unable to find any.
I wonder if any kind folks can help me out.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
1639117860060.png
 
Upvote 0
Welcome to the MrExcel board!

One example is not much to go on. To clarify the requirement, could you give 4 or 5 varied examples and the expected results?
 
Upvote 0
1639118677212.png


I am trying to find the TOP 4 CONSECUTIVE VALUE in row 2 by using Conditional Formatting to highlight the cells if there are top 4 consecutive value in row 2.

the result will look like the above top 4 highlighted in yellow. but i am unable to make it work in CF.
 
Upvote 0
i am sorry, newbie here. more examples in Row 2 to 5

I am trying to find the TOP 4 CONSECUTIVE VALUE in by individual rows by using Conditional Formatting to highlight the cells if there are top 4 consecutive value in row 2.
eg Row 2, the result(i did it manually) will look like the below top 4 highlighted in yellow (cell I2,J2,K2 & L2). but i am unable to make it work in CF. looking to see if anyone can help me out here.

1639122065852.png
 
Upvote 0
Thanks, that definitely shows a different interpretation to what I thought it might have been with just that first example. ;)

See if this works for you.
(You might also investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

21 12 10.xlsm
ABCDEFGHIJKL
1
2202060901010202050505050
3404040606060906090902020
410090700100600102005070040400
5200200200200700900700500500500500500
Top 4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:L5Expression=LET(st,SUBTOTAL(9,OFFSET($A2,,SEQUENCE(,COLUMNS($A2:$L2)-3,0),,4)),fc,MATCH(MAX(st),st,0),AND(COLUMNS($A:A)>=fc,COLUMNS($A:A)<fc+4))textNO
 
Upvote 0
works like a charm!! thank you! lifesaver :)

=LET(st,SUBTOTAL(9,OFFSET($A2,,SEQUENCE(,COLUMNS($A2:$L2)-3,0),,4)),fc,MATCH(MAX(st),st,0),AND(COLUMNS($A:A)>=fc,COLUMNS($A:A)<fc+4))

are the green column the variable should i decide to move my data set to a different column (eg. column E only)?
 
Upvote 0
works like a charm!! thank you!
You're welcome. :)

are the green column the variable should i decide to move my data set to a different column (eg. column E only)?
Everywhere I have an A it is the first column of the data. L is the last column of the data.
If you are unsure or have problems changing, just set it up exactly like the sample and then insert columns and/or rows until the data is where you really want it. Excel will do the adjustments for you.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

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