title: Median for frequency distribution
body: <p>I have data in excel that looks similar to the following:</p>
  
  <pre><code>|          |  1|  2|  3|  4|  5|
  |----------|---|---|---|---|---|
  |Question 1| 18| 20|  1|  1|  0|
  |Question 2|  9| 18|  9|  4|  4|
  |Question 3| 11| 10| 13|  6|  0|
  |Question 4|  4| 18| 10|  8|  0|
  </code></pre>
  
  <p>The table shows how many people chose any of the 5 possible answers (1-5) for several questions.</p>
  
  <p>I have tried the solutions that barry houdini suggested here: <a href="http://www.mrexcel.com/forum/excel-questions/530046-find-medians-frequency-distribution-table.html" rel="nofollow">http://www.mrexcel.com/forum/excel-questions/530046-find-medians-frequency-distribution-table.html</a></p>
  
  <p>But I get #N/A error.</p>
  
  <p>This is the exact formula that I used for data in B9:F18 and values in B8:F8:</p>
  
  <pre><code>=SUM(LOOKUP(INT(SUM(B9:F9)/2+{0.5,1}),SUBTOTAL(39,OFFSET(A9,,,1,COLUMN(B9:F9)-COLUMN(B9)+1))+1,B$8:F$8))/2
  </code></pre>