+ Reply to Thread
Results 1 to 11 of 11

Convert Letter to Number, then Calculate Average

  1. #1
    Registered User
    Join Date
    05-10-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Convert Letter to Number, then Calculate Average

    Greetings all,

    I have a problems that would be great if someone could solve.

    I've got a table that contains a number of dates and below that, an alphabetic grade that a person received on each date. I need to find a way to convert each alphabetic grade to a numeric grade and then get the average of that numeric grade to appear in the 'average' cell at the end.

    I know how to convert alphabetic to numeric and have that result appear in another column, but I need to just have the average of all the grades appear and I don't want to add any new columns. I know it's possible, but I can't get it to work.

    The alphabetic grades and their equivalents are: U=49.9, DC:62.5, VC=80, SC=90, EC=95.

    I've attached a simplified version of the doc.

    Thanks for your help in advance.

    Cheers
    Attached Files Attached Files
    Last edited by franklin1; 05-12-2010 at 12:47 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Convert Letter to Number, then Calculate Average

    Try:

    =SUMPRODUCT((B4:I4=B10:B14)*(C10:C14))/SUMPRODUCT(--(B4:I4=B10:B14))

    or if you arrange your table so that first column is in ascending order, then

    =AVERAGE(LOOKUP(B4:I4,B10:C14))

    confirmed with CTRL+SHIFT+ENTER not just ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Convert Letter to Number, then Calculate Average

    EDIT: NBVC's has better error checking in the formula. Go with that.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    05-10-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Convert Letter to Number, then Calculate Average

    Cheers NBVC. When I copy and paste the first formula into my document and make the necessary cell adjustments, I get a Divide by Zero Error.

    When I do the same to the second formula, I get a Value Not Available Error

    I can't see where this is coming from. Any ideas?

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Convert Letter to Number, then Calculate Average

    What are the necessary changes you made?

    The second formula needs to be confirmed with CTRL+SHIFT+ENTER keys so that { } brackets appear around the formula.

  6. #6
    Registered User
    Join Date
    05-10-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Convert Letter to Number, then Calculate Average

    I've attached a version of document I cut and pasted it in to. I just had to change the cell values in the formula to reflect the new document.

    Also, will it make a difference if some of the dates do not have grades in them?

    Cheers
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Convert Letter to Number, then Calculate Average

    You referenced the wrong range in the denominator...

    s.b. =SUMPRODUCT((B3:Y3=A7:A11)*(B7:B11))/SUMPRODUCT(--(B3:Y3=A7:A11))

  8. #8
    Registered User
    Join Date
    05-10-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Convert Letter to Number, then Calculate Average

    Thanks for that. That's great.

    I need to copy and paste that formula in order to work out the average grades for other people in the spreadsheet. When I do that, the reference to the table (the A7 to B11bit) shifts down so the formula no longer works. How do I copy and paste so I don't have to retype the formula for each person's grade.

    Cheers once again

  9. #9
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Convert Letter to Number, then Calculate Average

    =SUMPRODUCT((B3:Y3=$A$7:$A$11)*($B$7:$B$11))/SUMPRODUCT(--(B3:Y3=$B$7:$B$11))

    would allow you to copy it down!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  10. #10
    Registered User
    Join Date
    05-10-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Convert Letter to Number, then Calculate Average

    Thanks everyone. You've saved me a lot of time.

    Cheers

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Convert Letter to Number, then Calculate Average

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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