Cubist
Well-known Member
- Joined
- Oct 5, 2023
- Messages
- 1,819
- Office Version
- 365
- Platform
- Windows
- MacOS
Given a dynamic array of numerical values.
The array always starts with positive values. Once it turns negative, the remaining rows will be negative.
I want to turn the first negative value positive and the subsequent negative values into 0.
I'm looking for a dynamic array solution that can handle both cases below. TIA
The array always starts with positive values. Once it turns negative, the remaining rows will be negative.
I want to turn the first negative value positive and the subsequent negative values into 0.
I'm looking for a dynamic array solution that can handle both cases below. TIA
Book1 | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Case 1 | Expected | Case 2 | Expected | ||||
2 | 15 | 15 | 0 | 0 | ||||
3 | 35 | 35 | 0 | 0 | ||||
4 | 15 | 15 | 0 | 0 | ||||
5 | 26 | 26 | 0 | 0 | ||||
6 | 11 | 11 | 0 | 0 | ||||
7 | 18 | 18 | 0 | 0 | ||||
8 | -45 | 45 | 0 | 0 | ||||
9 | -29 | 0 | 0 | 0 | ||||
10 | -6 | 0 | 0 | 0 | ||||
11 | -6 | 0 | 0 | 0 | ||||
12 | -27 | 0 | 0 | 0 | ||||
13 | -25 | 0 | 0 | 0 | ||||
14 | -27 | 0 | 0 | 0 | ||||
15 | -19 | 0 | 0 | 0 | ||||
16 | -6 | 0 | 0 | 0 | ||||
17 | ||||||||
Sheet5 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A2:A16 | A2 | ={15;35;15;26;11;18;-45;-29;-6;-6;-27;-25;-27;-19;-6} |
B2:B7 | B2 | =A2:A7 |
D2:D16 | D2 | =SEQUENCE(15,1,0,0) |
Dynamic array formulas. |