I have a large dataset for medical research. 230 patients belonging to either of 6 diagnostic groups: RRMS, PPMS, SPMS, CIS, SC and OND

I need medians for the test result for each diagnostic group.

Column A Column B
Diagnosic group result of test
RRMS 110
PPMS 200
RRMS 80
SC 5
CIS 25
RRMS 95
PPMS 150
CIS 50
RRMS 150
RRMS 87


I need a formula that will return Median of result of test values for each diagnostic group.

I already tried : Median(IF(A:A="RRMS", B:B)) - but doesnt work..

Can anyone help? Regards Mikael