Need to get median of several sets of survey data, but I don't have the actual sets

MKindy

New Member
Joined
Jan 19, 2017
Messages
2
What I have is some data in this format:

How well does <statement> apply to you?
(1 = Entirely, 5 = Not at All)</statement>

<tbody>
</tbody>
Question #12345# Responding
17411114
2001124
3142018

<tbody>
</tbody>

This tells me that for question 1, 14 people responded, with 7 picking "1", 4 picking "2" and 1 each picking "3", "4", and "5". Same pattern for subsequent questions; and, as you can see, the questions did not need to be answered at all, so the # of respondents changes.

It's easy enough to just build an array for each question to find the median -- e.g., question 1. [ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 4, 5 ], median 1 or 2 (or 1.5) -- but there are 54 questions not represented here, and then I have to do it all again with the next survey, etc. Is there a way to utilize MEDIAN(), telling it the structure of the array using the data provided? Or a way to automatically build an array by laying out values in some hidden cells based on the data provided?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
AM not certain how you would treat zeroes but here's an idea


Excel 2010
ABCDEFGHI
2Question #12345# RespondingString of ResponsesMedian
317411114111111122223451.5
4200112434554.5
53142018122223352
Sheet4
Cell Formulas
RangeFormula
H3=REPT(B$2,B3)&REPT(C$2,C3)&REPT(D$2,D3)&REPT(E$2,E3)&REPT(F$2,F3)
I3=IF(ISODD(LEN(H3)),MID(H3,ROUNDUP(LEN(H3)/2,0),1),0.5*(MID(H3,INT(LEN(H3)/2),1)+MID(H3,INT(LEN(H3)/2)+1,1)))
 
Upvote 0
That did the trick! Thanks for helping out a newbie.

Zeroes managed themselves, since the REPT function returns a null string if given 0 as its second parameter.
 
Upvote 0

Forum statistics

Threads
1,216,150
Messages
6,129,154
Members
449,488
Latest member
qh017

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