Percentage of new highs (simple array please)

chipps24

New Member
Joined
Feb 2, 2015
Messages
17
Hi, I'm sure this will be pretty simple for the advanced users on this forum, but thanks vm in advance.

I would like an array formula that calculates the percentage of occurrences that a series of data makes a new high.

Column A - data (it rises and falls)
Column B - intermediate step to calculate when a new high is reached. Note the definition of a new high includes the entire series.

D1 - the answer required.

As always your help is much appreciated.

Thanks vm.


Excel 2013 32 bit
ABCD
1143%
22h
33h
44h
55h
64
73
82
93
104
115
126h
137h
148h
159h
168
179
1810h
199
208
217

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D1=COUNTIF(B1:B21,"h")/COUNT(A1:A21)
B2=IF(A2>MAX($A$1:A1),"h","")
B3=IF(A3>MAX($A$1:A2),"h","")
B4=IF(A4>MAX($A$1:A3),"h","")
B5=IF(A5>MAX($A$1:A4),"h","")
B6=IF(A6>MAX($A$1:A5),"h","")
B7=IF(A7>MAX($A$1:A6),"h","")
B8=IF(A8>MAX($A$1:A7),"h","")
B9=IF(A9>MAX($A$1:A8),"h","")
B10=IF(A10>MAX($A$1:A9),"h","")
B11=IF(A11>MAX($A$1:A10),"h","")
B12=IF(A12>MAX($A$1:A11),"h","")
B13=IF(A13>MAX($A$1:A12),"h","")
B14=IF(A14>MAX($A$1:A13),"h","")
B15=IF(A15>MAX($A$1:A14),"h","")
B16=IF(A16>MAX($A$1:A15),"h","")
B17=IF(A17>MAX($A$1:A16),"h","")
B18=IF(A18>MAX($A$1:A17),"h","")
B19=IF(A19>MAX($A$1:A18),"h","")
B20=IF(A20>MAX($A$1:A19),"h","")
B21=IF(A21>MAX($A$1:A20),"h","")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 

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.
Maybe something like this?

ABCD
1143%
22h
33h
44h
55h
64
73
82
93
104
115
126h
137h
148h
159h
168
179
1810h
199
208
217
22

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet5

Array Formulas
CellFormula
D1{=SUM((--(A2:A21>SUBTOTAL(4,OFFSET(A1,0,0,ROW(A1:A20))))))/21}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
Thanks very much Eric. Is there any reason why the formula works in the very basic 'example' spreadsheet created to communicate on this forum, and not in my more complex workbook that contains the real actual data? ie, is there some sort of setting I need to apply? The formula works perfectly in the basic workbook, but not in my main book. I have ensured that the curly brackets are working too, and that the cell references are aligned perfectly as per your example formula.


Mancubus, I have a very workbook with many similar calculations to perform, so I need this to keep my workbook as efficient as possible.


thanks vm
 
Upvote 0
I can't see any reason why it shouldn't work on your full data. Did you change the cell references?

=SUM((--(A2:A21>SUBTOTAL(4,OFFSET(A1,0,0,ROW(A1:A20)-ROW(A1)+1)))))/21


​You used the COUNT function to get the 21 while I just put in the length of the range.

I added the -ROW(A1)+1 in case your range doesn't start in row 1.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

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