ibmy
Board Regular
- Joined
- Mar 4, 2020
- Messages
- 134
- Office Version
- 2016
- Platform
- Windows
Hi Mr Excel,
Before I give data sample, let me explain the sequence pattern in picture and the criteria.
Criteria of Sequence Pattern :
(1) Must at least starting with postive number, follow by negative number. ( + - )
(2) Keep assign "1" the cycle until 'invalid' happen ( + - + - + - + - + - ......... )
(3) Invalid,Stop Assign : Posive / Negative number appear two time consecutively. ( + - + - - ) / ( + - + - + - ++ )
(4) Invalid,Stop Assign : 0 appear. ( + - + 0 ) / ( + - + - + - 0 )
Expected result in Column H.
Dont mind any method of getting the result ( formula, column helper, vba, etc... ) as long as work fine in 300k row data.
Thanks in advance.
Before I give data sample, let me explain the sequence pattern in picture and the criteria.
Criteria of Sequence Pattern :
(1) Must at least starting with postive number, follow by negative number. ( + - )
(2) Keep assign "1" the cycle until 'invalid' happen ( + - + - + - + - + - ......... )
(3) Invalid,Stop Assign : Posive / Negative number appear two time consecutively. ( + - + - - ) / ( + - + - + - ++ )
(4) Invalid,Stop Assign : 0 appear. ( + - + 0 ) / ( + - + - + - 0 )
plus minus.xlsb | ||||||
---|---|---|---|---|---|---|
F | G | H | I | |||
1 | b | Expected Result | ||||
2 | ||||||
3 | -0.4 | |||||
4 | 1 | |||||
5 | 0 | |||||
6 | 0.9 | |||||
7 | -0.1 | 1 | ||||
8 | -0.3 | |||||
9 | 0.1 | |||||
10 | 0.1 | |||||
11 | -0.1 | 1 | ||||
12 | 0.1 | 1 | ||||
13 | 0.8 | |||||
14 | 0 | |||||
15 | 0.1 | |||||
16 | -0.6 | 1 | ||||
17 | 0.7 | 1 | ||||
18 | -0.9 | 1 | ||||
19 | 1 | 1 | ||||
20 | -1.6 | 1 | ||||
21 | 0.7 | 1 | ||||
22 | 0.3 | |||||
23 | -0.3 | 1 | ||||
24 | 0.1 | 1 | ||||
25 | -0.6 | 1 | ||||
26 | -0.3 | |||||
27 | 0.1 | |||||
28 | -0.6 | 1 | ||||
29 | -0.5 | |||||
30 | 0.2 | |||||
31 | -0.1 | 1 | ||||
32 | 0 | |||||
33 | 0 | |||||
34 | 0 | |||||
35 | 0.1 | |||||
36 | 0.1 | |||||
37 | -0.3 | 1 | ||||
38 | ||||||
Sheet6 |
Expected result in Column H.
Dont mind any method of getting the result ( formula, column helper, vba, etc... ) as long as work fine in 300k row data.
Thanks in advance.