Summing Data by Quartile

numbers4days

New Member
Joined
Sep 20, 2017
Messages
2
I have a bunch of stocks that I have ranked by tercile (1,2,3) according to their market value in a period. If a stock is in tercile 1 in Period 1, if the stock price moves a lot, it could end up in Tercile 2 in Period 2, and etc etc. By the way, if the market value is $0, that just means it isn't part of the portfolio, so it should be excluded from the analysis/tercile rankings.

I also have a set of period returns in each period that pertain to each stock

What I am trying to do is to calculate the sum of the period returns pertaining to the tercile. I am struggling with this because the terciles are not static and move period to period. So, what I want is the sum of period returns in the 1/8/17 column to only include Stock C for Tercile 2, and thus should be -0.2%. But Tercile 2 in the 1/15/17 column will then pertain to Stock A.

THANK YOU for any ideas.


1/1/171/8/171/15/17
Stock A55.255.25
Stock B131314
Stock C18150
Stock D222.50
Stock E0020
TOTAL3825.2541.75
Weight
A13%21%13%
B34%51%34%
C47%20%0%
D5%8%6%
E0%0%48%
Tercile
A232
B333
C320
D111
E003
Period Return
A-5.0%1.9%
B0.0%0.1%
C-0.2%0.0%
D0.3%0.6%
E-1.3%-2.1%
Sum Period Total Return
1
2
3

<tbody>
</tbody>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I was just about to paste here an array formula solution when I realized this is actually just a SUMIF if I understand correctly...

=SUMIF(D2:D6,A16,D9:D13)

In this example D2:D6 are the terciles, A16 is the tercile you are looking for, D9:D13 are the period returns

Is that what you are looking for?
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,639
Members
449,093
Latest member
Ahmad123098

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top