meohen1992
New Member
- Joined
- Jul 30, 2023
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
Hi everyone,
I am trying to find consecutive numbers with largest value.
I have used the formula then did not worked exactly like I want:
=MAX(FREQUENCY(IF(A2:A26>0,ROW(A2:A26)),IF(A2:A26<=0,ROW(A2:A26))))
This formula return longest sequence of numbers, not consecutive numbers with largest value...
The result I want is : 6 and 3839
Thanks,
Huy
I am trying to find consecutive numbers with largest value.
I have used the formula then did not worked exactly like I want:
=MAX(FREQUENCY(IF(A2:A26>0,ROW(A2:A26)),IF(A2:A26<=0,ROW(A2:A26))))
This formula return longest sequence of numbers, not consecutive numbers with largest value...
The result I want is : 6 and 3839
Thanks,
Huy
Book1 | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Value | Consecutive positive | Sum this | Consecutive with largest number | Sum this | |||
2 | 623 | 11 | 1,785 | 6 | 3,839 | |||
3 | 212 | Result Formula I want | ||||||
4 | 109 | |||||||
5 | 291 | |||||||
6 | 280 | |||||||
7 | 2,325 | |||||||
8 | -1,575 | |||||||
9 | 632 | |||||||
10 | 1,287 | |||||||
11 | -1,175 | |||||||
12 | 368 | |||||||
13 | -285 | |||||||
14 | -497 | |||||||
15 | -9 | |||||||
16 | 429 | |||||||
17 | 173 | |||||||
18 | 90 | |||||||
19 | 18 | |||||||
20 | 57 | |||||||
21 | 10 | |||||||
22 | 63 | |||||||
23 | 444 | |||||||
24 | 410 | |||||||
25 | 69 | |||||||
26 | 22 | |||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2 | B2 | =MAX(FREQUENCY(IF(A2:A26>0,ROW(A2:A26)),IF(A2:A26<=0,ROW(A2:A26)))) |
C2 | C2 | =MAX((COUNTIF(OFFSET(A2:A26,ROW(A2:A26)-ROW(A2),0,B2),">=0")=B2)*SUBTOTAL(109,OFFSET(A2:A26,ROW(A2:A26)-ROW(A2),0,B2))) |
E2 | E2 | =COUNT(A2:A7) |
F2 | F2 | =SUM(A2:A7) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
F2 | Cell Value | >0 | text | NO |
F2 | Cell Value | <0 | text | NO |
C2 | Cell Value | >0 | text | NO |
C2 | Cell Value | <0 | text | NO |
A2:A26 | Cell Value | >0 | text | NO |
A2:A26 | Cell Value | <0 | text | NO |