Hi all,
I have created a line chart in Excel that shows me a company's share price over a 10 year period. I then have two further lines that show me a "Target" price and a "Maximum" price.
What I would like to do is create a horizontal stacked bar chart (ideally overlaid on my original chart so I have just one chart but if not possible then happy to have two) that corresponds to whether or not I am below target, between target and max, or above max.
So for example for the first three months my data is below target so I want the first "stack" of my chart to be red, when I cross over target and am now between target and max I want my stack to be amber. I've attached a really crude drawing to this post.
What I have done so far is to create an IF statement to show me if I'm above/between/below and return a 1/2/3 accordingly (could be any value). I think then to create my "stack" sizes I need to count this array until it changes to a different number and then count from there until it changes again but I'm just not sure how to do this and/or if there is an easier way. I tried doing it manually but I have over 4,000 data points so was very long-winded!
Really quick example array:
1
1
1
1
2
3
3
2
1
1
So my stack sizes would be: 4, 1, 2, 1, 2 - how do I get these numbers without counting manually?
I hope that makes sense but happy to clarify anything!
I have created a line chart in Excel that shows me a company's share price over a 10 year period. I then have two further lines that show me a "Target" price and a "Maximum" price.
What I would like to do is create a horizontal stacked bar chart (ideally overlaid on my original chart so I have just one chart but if not possible then happy to have two) that corresponds to whether or not I am below target, between target and max, or above max.
So for example for the first three months my data is below target so I want the first "stack" of my chart to be red, when I cross over target and am now between target and max I want my stack to be amber. I've attached a really crude drawing to this post.
What I have done so far is to create an IF statement to show me if I'm above/between/below and return a 1/2/3 accordingly (could be any value). I think then to create my "stack" sizes I need to count this array until it changes to a different number and then count from there until it changes again but I'm just not sure how to do this and/or if there is an easier way. I tried doing it manually but I have over 4,000 data points so was very long-winded!
Really quick example array:
1
1
1
1
2
3
3
2
1
1
So my stack sizes would be: 4, 1, 2, 1, 2 - how do I get these numbers without counting manually?
I hope that makes sense but happy to clarify anything!