Forum Discussion
Michele711855
Jul 14, 2022Copper Contributor
Progressive numbering with variables
Hello everybody. Hope you can help me.
I'm looking for a compound formula that allows me to result in an incremental number based on two variables.
Column A -> I have a series of dates they can be also duplicated
Column B -> I have values 0 or 1
If the cell in column B equals 0 the result will always be -1, this is simple.
Therefore:
Cell C2 = -1 because B2 = 0
Cell C1 = 1 because cell B1 = 1 and in the set of column A where the dates are May 25 this is the first row of this range
Now comes the problem that I can't solve:
Cell C3 = 2 because B3 = 1 and A3 is part of the "May 25"'s range and is the second occurrence in which this two rules are verified.
And so on.
A | B | C | |
1 | 25-mag | 1 | 1 |
2 | 25-mag | 0 | -1 |
3 | 25-mag | 1 | 2 |
4 | 25-mag | 1 | 3 |
5 | 25-mag | 0 | -1 |
6 | 25-mag | 1 | 4 |
7 | 26-mag | 1 | 1 |
8 | 26-mag | 1 | 2 |
9 | 26-mag | 0 | -1 |
10 | 26-mag | 1 | 3 |
Can someone help me?
Thank you for your help,
Michele.
- Riny_van_EekelenPlatinum Contributor
- Michele711855Copper ContributorThanks Riny 😉
- OliverScheurichGold Contributor
- Michele711855Copper ContributorOhhh, so simple...
Thanks.