Sorting portfolios based on criterias

Myura

New Member
Joined
Feb 26, 2016
Messages
36
My current table looks like this

Company-----year----size-----Exchange
A---------------2000-----80-------A
A---------------2001-----85-------A
B---------------2002------90------C

I want to allocate the companies into two categories "Big" and "Small".

For a particular year, if the companies size is bigger than the median of the size of the companies in that year in Exchange A, will be called "BIG".
something like this,

=if([size]>MEDIANX(filter(filter(tbl1,[Year]=A),[Year]),[size]),"Big","Small")

I know the way I used the filters are wrong. I do not know how to do this. Please help me.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This should be super close:

=if(tbl1[size] > calculate(MEDIAN(tbl1[size]), FILTER(ALL(tbl1), tbl1[Year] = EARLIER(tbl1[Year]) && tbl1[Exchange] = EARLIER(tbl1[Exchange])), "big", "small")
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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