Consider the following Excel worksheet:
| A B C
--+--------------------
1 | company day return
--+--------------------
2 | 1 1 2
3 | 1 2 1
4 | 1 3 1
5 | 2 1 3
6 | 2 2 2
7 | 2 3 0
8 | 3 1 1
9 | 3 2 5
10 | 3 3 1
The worksheet is panel timeseries basically. In the example, it lists the stock returns for 3 companyies for 3 conseutive days. I now want to graph the total return (so: accumulated return for all companies) per day, as follows:
return 8 | * (C3+C6+C9=1+2+5=8)
7 |
6 | * (C2+C5+C8=2+3+1=6)
5 |
4 |
3 |
2 | * (C4+C7+C10=1+0+1=2)
1 |
0 +----------------------
1 2 3 day
Is this possible to do in Excel and if so, how?
Setup a new chart graph on another sheet to group the data from your first larger chart into this format:
Then, set the formula in cell B2 to something like = SUMIFS(C:C,A:A,A1,B:B,A2)
Where
C:C,B:BandA:Areference the columns in the original graph and theA1andA2Reference the grouping chart.Note that the
SUMIFSformula is for Excel 2007 / 2010. I’ve included example worksheets for this method and using the same approach with an Array formula in older versions of excel.Here is an example file for Excel version 2007 / 2010: https://dl.dropbox.com/u/19599049/GroupData_NewExcel.xlsx
Here is an example for old versions of excel:
https://dl.dropbox.com/u/19599049/GroupData_OldExcel.xls