Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IF Statement nested in MEDIAN Function not generating list in Excel

I'm working on some statistics for some classes at my school. I'm trying to have a formula that will calculate the median of ratings for the different classes. My formula I have is:

=MEDIAN(IF(Table1[Class]="AR",Table1[Rating]))

But I can not figure out why the IF statement doesn't output correctly into the MEDIAN Function.

From what I understand, the IF statement should look through column A's list of classes and see if they are "AR", if they are, they should output that value, if not, then output nothing. (I am aware that the output of nothing is not possible and it will output 0.)

If anyone could help, that would be great!

Picture of Formula In Action

Excel File

like image 412
CodeNeedsCoffee Avatar asked Dec 31 '25 17:12

CodeNeedsCoffee


1 Answers

Thanks to the help from Scott Craner, the answer is to press CTRL+SHIFT+ENTER when you are finished typing the formula. This will allow the IF statement to be able to output more than one value into the median function, this process is also known as an array.

like image 196
CodeNeedsCoffee Avatar answered Jan 04 '26 14:01

CodeNeedsCoffee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!