Forum Discussion
Formula to see how often and how long something happens?
- Mar 20, 2021
Please check in attached. You need to drag cells from three columns at once.
Please check in attached. You need to drag cells from three columns at once.
Dear Sergei.
Thank you very much for this. It is extremely helpful! These formulas look like some black magic!
I was wondering if you could help with the next step of this.
Suppose, I would like to know, how often a banking crisis happened in a country (I have the data, we are concerned about the beginning of the banking crisis not how many years it lasted so we assume just one year) in relation to the occurrence of such episodes when GDP growth was more than 3% per year.
Specifically, I would like to know if:
1. A banking crisis happened during the first year of such an episode of 3% growth.
2. A banking crisis happened during the last year of such an episode of 3% growth.
3. A banking crisis happened during an episode of 3% growth (not the first year not the last year).
4. A banking crisis happened the very next year after the episode of a 3% growth.
I populated this with examples of banking crises for Australia (fictional data).
- SergeiBaklanMar 20, 2021MVP
Could you please clarify why in your sample you marked as first crisis end of first episode, not it's beginning, and same for other columns.
- DanathanPL89Mar 21, 2021Copper Contributor
Dear Sergei,
thank you for looking into this.
For instance, please look at the first case below.
The episode when GDP was above 3% was first between 1872-1876. The first crisis happened in 1877 (Column J). This is the next year the episode of 3% growth ended.
Therefore, from the columns L-M-N-O, I would like "1" to be at 1877 under Column O. The logic is that I first look at when the crisis happened (Arrow A). Then I look how does it corresponds to the conditions at columns L-M-N-O (that is Arrow B). And this then allocates the "1" to Column O.
Similar rational I present for the remaining Columns below.
- SergeiBaklanMar 22, 2021MVP
Thank you for the explanation. But when next numbers( 1 in column J in rows 1892,1897,1899,1901) are not clear. Is next sequence of crises (for next years) repeats this logic or not?
- dmacgmeMar 21, 2021Copper ContributorThe results you are looking for can all be found by applying the same type of conditional formulae that Sergei already laid out. It's a closed set of conditions so all that is needed is a logical test on each data point of concern - eg:
if GDP in year x < .03 AND GDP in year (x +1) >= .03
that will indicate your first year of 3% growth, to find the other scenarios just modify your conditions as needed. Put the results as a Boolean (1 for true) as new columnar data in the time series and the "how often" question is the sum of each column.