Highlighting 36 consecutive months of highest value

ChrisCione

Board Regular
Joined
Aug 27, 2008
Messages
92
Office Version
  1. 365
Platform
  1. Windows
I am using the following formula to find the largest sum of 36 consecutive values in a sizable range: MaxN(36,K2:K181)

Is there a method to highlight or otherwise identify which 36 consecutive values Excel is using?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
This is what I came up with. To work with a smaller example, I used six consecutive values rather than 36. I am certain there is a cleaner way to do this, but I have not figured it out...:unsure:
Book1
AB
121
2162870
3611020
41661307
5561222
62361526
71891429
83121369
93481181
1081957
11360989
121391000
131291156
141241253
151241186
161131179
173711307
182951141
192261119
20571241
211171468
222411665
232051483
242731366
253481242
26284 
27314 
2859 
2988 
30149 
Sheet1
Cell Formulas
RangeFormula
B1B1=MATCH(MAX(B2:B30),B2:B30,0)
B2:B30B2=IF(COUNT(A2:A7)=6,SUM(A2:A7),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A30Expression=AND(ROW(A2)>$B$1,ROW(A2)<=$B$1+6)textNO

Hope that helps,

Doug
 
Upvote 0
No idea what MaxN is, but how about
Fluff.xlsm
KN
23994
36179
42153
51780
69496
77963
85395
98083
109688
116379
129595
138332
148899
157975
1695100
173297
189971
197571
2010072
219725
227172
237183
247282
252576
267223
278352
288259
297688
302394
315291
325926
338878
349496
359142
362698
377879
3896
3942
4098
4179
4269
4380
4440
4533
4637
4772
4848
4926
50100
Data
Cell Formulas
RangeFormula
N2:N37N2=LET(s,SCAN(0,SEQUENCE(180),LAMBDA(a,b,SUM(CHOOSEROWS(K2:K300,SEQUENCE(36,,b))))),CHOOSEROWS(K2:K300,SEQUENCE(36,,XMATCH(MAX(s),s))))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,822
Members
449,190
Latest member
rscraig11

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