+ Reply to Thread
Results 1 to 14 of 14

Finding median of range of cells containing text and numbers

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Finding median of range of cells containing text and numbers

    Dear all,

    I am attemting to write a formula that can calculate the median of a range of cells containing text and numbers.

    More specifically the cells contain the following code: yyyy Qx e.g. 1988 Q2.

    I have tried variations on the formula below, but without success.

    =MEDIAN(VALUE(LEFT(J16:J53,FIND(" ",J16:J53)-1)))
    =VALUE(LEFT(MEDIAN(J16:J53),FIND(" ",MEDIAN(J16:J53)-1)))

    Any good ideas??

    Thanks a lot!!

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding median of range of cells containing text and numbers

    Please attach a sample workbook with expected output for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Finding median of range of cells containing text and numbers

    I am sorry, here is a sample.

    Thanks a lot!
    Attached Files Attached Files

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding median of range of cells containing text and numbers

    Please confirm the expected result also

  5. #5
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Finding median of range of cells containing text and numbers

    Generally, I would like to do array calculations on that array, as if it was containing numbers only. I would also like to apply the following formula below it, but I cannot figure out how to combine the VAlue(left... formula with the array setup:-)

    =SUM(2012-A1:A38)

    Would be very glad if anybody had a smart way to do this (without transforming the actual input setup i.e. numbers + text)

    Thanks a lot for helping..This is a super forum, I hope I will be good enough at this to help one day!

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding median of range of cells containing text and numbers

    Sorry I am unable to continue with this thread since not getting requested details

  7. #7
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Finding median of range of cells containing text and numbers

    But I have attached the sample file above??

  8. #8
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Finding median of range of cells containing text and numbers

    Sorry, didn't see the expected result request: it is 1994 (the median of the numbers in the cells).

    Thanks:-)

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Finding median of range of cells containing text and numbers

    Array Formula - Should be entered with CTRL+SHIFT+ENTER
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Finding median of range of cells containing text and numbers

    Try this "array formula"

    =MEDIAN(LEFT(A1:A38,4)+0)

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  11. #11
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Finding median of range of cells containing text and numbers

    Thanks a lot to both of you, they both work perfectly! Also with the other formula:-)

  12. #12
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Finding median of range of cells containing text and numbers

    I am sorry, I have one more question, if you don't mind.

    I wish to select only certain rows in my column range and have attempted with the formula below (my values are placed in column J instead of column A from the uploaded sample) which however does not work properly. What should I do to only select only certain of the rows in the range?

    =MEDIAN(LEFT(J16:J18:J20:J20:J23:J23:J25:J27:J30:J34:J38:J38:J40:J42:J44:J44:J48:J53,4)+0)

    Thanks a lot

  13. #13
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Finding median of range of cells containing text and numbers

    That's not easy to do because you can only apply LEFT function to a single cell or a specific range, not a list of cells/ranges. If you can identify the rows to include in the worksheet then that's easier, e.g. if you put an "x" in column X for all the rows you want to include

    =MEDIAN(IF(X2:X100="x",LEFT(J2:J100,4)+0))

    confirmed with CTRL+SHIFT+ENTER

  14. #14
    Registered User
    Join Date
    02-12-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Finding median of range of cells containing text and numbers

    Thanks a lot, that is an excellent solution!
    You have really saved my day (several times). Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1