Hello guys,
My data set is like this:
<tbody>
</tbody>
What I want to do is to run double sorts in VBA. The sample here is cross-sectional, but my data also has time dimension. What I need to calculate is the percentrank.INC of each stock. Lets take stock 1 as an instance, this stock belongs to group W, and its value of criteria 2 is 0.9. I want to calculate the percentranl.Inc of its criteria 2 within the W group. (We also have NA in both criteria1,2 columns)
As what I mentioned, I also need to repeat this step over a long period. Therefore, I prefer to using VBA code for this scenario.
Thank you guys so much.
My data set is like this:
Stock | Return | Criteria1 | Criteria2 | Percentrank.INC |
1 | 0.1 | W | 0.9 | |
2 | 0.3 | M | 0.7 | |
3 | 0.2 | NA | 0.3 | |
4 | 0.1 | L | 0.5 | |
5 | 0.5 | M | 0.33 | |
6 | 0.2 | W | 0.88 | |
7 | 0.1 | W | NA | |
8 | 0.4 | L | 0.2 | |
9 | 0.2 | L | 0.77 |
<tbody>
</tbody>
What I want to do is to run double sorts in VBA. The sample here is cross-sectional, but my data also has time dimension. What I need to calculate is the percentrank.INC of each stock. Lets take stock 1 as an instance, this stock belongs to group W, and its value of criteria 2 is 0.9. I want to calculate the percentranl.Inc of its criteria 2 within the W group. (We also have NA in both criteria1,2 columns)
As what I mentioned, I also need to repeat this step over a long period. Therefore, I prefer to using VBA code for this scenario.
Thank you guys so much.