Manual calculation of the median from a series of grades

JC21

New Member
Joined
Sep 19, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I have an Excel spreadsheet with students who received a certain grade on an assessment. They are listed in alphabetical order, as follows:

series_grades.jpg

I would like to perform the following statistical dispersion operations: median, Q1, and Q3 on this series of grades WITHOUT using Excel's built-in functions. This first requires that the data series be sorted in ascending order. However, I want the data series to remain in its original order, and only have the three values corresponding to: the median, Q1, and Q3 appear in three cells next to my table. How can I perform such operations on my original table while keeping it unchanged? Should I create a sort of "temporary" table where the data is sorted in ascending order and then perform the operations? Is there a formula in Excel to do this?

Thank you for your help
 
Here are a couple of formula ways to get the MEDIAN.
The formulas in B4 & B5 are the same. The one in B5 just use the LET function. Formula in B6 is just a check using the Excel Median.
As you know you have to sort the data and also determine if you have a even or odd number of samples.
Maybe from this example you can figure out hoew to get the Q1 & Q3.

Median Manual Cal.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1EleveArcBetCasChaDelDesEl'/FouFriGaiGilHerH ubLafLePLouMagMarMigMorNavPalPerRajRouSacSaiVerVey
2Controlel7.5867.566.5998.51099710278.5109105.51049.54108.5108.5
3
4Median8.5
5Let Function8.5
6Excel Median8.5
7
Sheet4
Cell Formulas
RangeFormula
B4B4=IF(ISODD(COUNT(B2:AD2)),INDEX(SORT(B2:AD2,,,TRUE),ROUNDUP(COUNT(B2:AD2)/2,0)),AVERAGE(INDEX(SORT(B2:AD2,,,TRUE),COUNT(B2:AD2)/2),INDEX(SORT(B2:AD2,,,TRUE),COUNT(B2:AD2)/2+1)))
B5B5=LET(ct,COUNT(B2:AD2),s,SORT(B2:AD2,,,TRUE),IF(ISODD(ct),INDEX(s,ROUNDUP(ct/2,0)),AVERAGE(INDEX(s,ct/2),INDEX(s,ct/2+1))))
B6B6=MEDIAN(B2:AD2)
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
You need to specify which functions are "allowed" and which are "not allowed".
I just don't want to use the built-in functions "median" and "quartiles"
so I imagined i had to create a temporary table where values would be ranged in ascending order
 
Upvote 0
Another Median formula, no extra tables or internal sorting:

Excel Formula:
=LET(c,COUNT(B2:AD2),AVERAGE(SMALL(B2:AD2,SEQUENCE(2-MOD(c,2),,INT((c+1)/2)))))

And incidentally, why don't you want to use those functions?
 
Upvote 0
How about this?:

Book3.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1EleveArcBetCasChaDelDesEl'/FouFriGaiGilHerH ubLafLePLouMagMarMigMorNavPalPerRajRouSacSaiVerVey
2Controlel7.5867.566.5998.51099710278.5109105.51049.54108.5108.5
3
4
5Median8.5
6Q17
7Q39.5
Sheet2
Cell Formulas
RangeFormula
B5B5=LET(d, B2:AD2, sd, SORT(d, ,,1), n, COLUMNS(d), q, INT(n/2), IF(ISEVEN(n), (INDEX(sd, 1, q)+INDEX(sd, 1, q+1))/2, INDEX(sd, 1, q+1)) )
B6B6=LET(d, B2:AD2, n, COLUMNS(d), sd, TAKE(SORT(d, ,,1), 1, INT(n/2)+1), nn, COLUMNS(sd), q, INT(nn/2), IF(ISEVEN(nn), (INDEX(sd, 1, q)+INDEX(sd, 1, q+1))/2, INDEX(sd, 1, q+1)) )
B7B7=LET(d, B2:AD2, n, COLUMNS(d), sd, DROP(SORT(d, ,,1), , INT(n/2)), nn, COLUMNS(sd), q, INT(nn/2), IF(ISEVEN(nn), (INDEX(sd, 1, q)+INDEX(sd, 1, q+1))/2, INDEX(sd, 1, q+1)) )


No need for helper cell/tables
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,080
Members
453,021
Latest member
Justyna P

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