Convert table of Daily Stock data into Monthly data

6 views (last 30 days)
I have a 13000x3000 table with colums representing the dates and rows representing the stocks with values of daily stock returns in it.
Now I'd like to get the monthly sum of returns for each stock (each line).
Would appreciate any kind of help.

Accepted Answer

Cris LaPierre
Cris LaPierre on 12 Mar 2021
Look into groupsummary.
Use the date info as your groupvar.
Use the appropriate value for your groupbin (sounds like you want 'monthly').
Specify the desired method (sounds like you want 'sum')
Fabian Niederreiter
Fabian Niederreiter on 20 Mar 2021
Thanks for your help Chris! With some adjustments to my data I managed to make it work with the help of groupsummary. :)

Sign in to comment.

More Answers (0)


Find more on Cell Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by