+ Reply to Thread
Results 1 to 11 of 11

Help displaying a text value for a numerical value

  1. #1
    Registered User
    Join Date
    04-25-2015
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    23

    Help displaying a text value for a numerical value

    Hey all,

    I'm a teacher trying to create an excel document that analyses student data.

    I'm trying to work out what is the average NUMERICAL grade for each student, but only if they have an X next to their name. I used this formula:

    =AVERAGEIFS('Pupil Data Table'!J9:J155,'Pupil Data Table'!AA9:AA155,"x")

    It works absolutely fine... except that now, I don't want it to give the numerical average as the value in the box, instead I want it to convert to a LETTER grade.

    For example, there are 24 possible numbers, and the average could be any one of those numbers. However, if the answer to the average was 1 for example, I don't want it to show 1, but instead show "1C"... If it was 2, I'd want it instead to show "1B"... if it was 24, I'd want it instead to show "8A".

    Can anyone help? Hopefully this made sense...

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Help displaying a text value for a numerical value

    Hello,
    If the averages are precisely 1,2,3,4 upto 24 and you want grades as stated, you can use following formula in this particular situation.
    Please Login or Register  to view this content.
    Else you can also try vlookup method. Check attached for both solutions (check both sheets in the workbook attached).
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Help displaying a text value for a numerical value

    I am Sorry the formula should be
    Please Login or Register  to view this content.
    Check updated sheet.excelforum-60.xlsx
    Last edited by sourabhg98; 01-22-2016 at 12:36 PM.

  4. #4
    Registered User
    Join Date
    04-25-2015
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    23

    Re: Help displaying a text value for a numerical value

    That's brilliant thank you... I've heard of this VLOOKUP thing before...

    The only thing is... How do I do all that in one cell? Is it possible to do VLOOKUP in the same cell as
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ... Like, I want the cell to work out the numerical value and then ALSO convert it... all in one cell...

  5. #5
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Help displaying a text value for a numerical value

    No, Vlookup needs to have a proper data table like I created from where the average value can be searched and corresponding grade values be shown.
    However if you can precisely tell what grades you want for what averages we can maybe workout a formula in a single cell without the need to create that data table.

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Help displaying a text value for a numerical value

    Hello MrMM, could you post a sample book so things can be worked out much better
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  7. #7
    Registered User
    Join Date
    04-25-2015
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    23

    Re: Help displaying a text value for a numerical value

    Here,

    So I've made it anonymous. So, on the first sheet what you see is names of students and then their grades at different times of the year. Their grades are letter format... 3A... 5A... 6C etc... and then for each grade column, I created a separate column (which I'm hiding), which converts that letter grading in to a chronological number so that I can run a couple of statistics (which you'll see on sheet 2). I wasn't able to find a way to do these statistics on the letter format, so had to change it to numerical.

    On Sheet 2,Cell C 47 and 48, I want to know what the average grade is for a group of students. It's easy to do on the numerical values, which I've done... the formula gives me the numerical average... but now I want to convert that BACK to letter format. I.E... It's telling me that the average level for MAT students is 16... which I know is equivalent to 6C... but instead of it writing 16 there, I want it to write 6C...

    Does that make sense?
    Attached Files Attached Files

  8. #8
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Help displaying a text value for a numerical value

    Hi,
    Okay then try this formula in C47-

    Please Login or Register  to view this content.
    I think that would fulfill your requirements.
    Do reply if you this was not what you needed.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,923

    Re: Help displaying a text value for a numerical value

    try

    Try

    =VLOOKUP(AVERAGEIFS('Pupil Data Table'!$J$9:$J$155,'Pupil Data Table'!$AA$9:$AA$155,"x"),'Pupil Data Table'!$AJ$2:$AK$25,2,1)

    and

    =VLOOKUP(AVERAGEIFS('Pupil Data Table'!$J$9:$J$155,'Pupil Data Table'!$AB$9:$AB$155,"x"),'Pupil Data Table'!$AJ$2:$AK$25,2,1)


    Highlighted formula is range of your Lookup table (numbers in AJ, Codes in AK)

  10. #10
    Registered User
    Join Date
    04-25-2015
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    23

    Re: Help displaying a text value for a numerical value

    Awesome, thank you so much, it worked!!! Both worked actually, but I went with the VLOOKUP option because I'm probably going to have to use the data conversion table at some point anyway.

    Now I just need to work out how to remove or hide the #DIV/0! error !! I'll work it out!

    Thanks so much!

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,923

    Re: Help displaying a text value for a numerical value

    Remove errors ...

    =IFERROR(VLOOKUP(AVERAGEIFS('Pupil Data Table'!$J$9:$J$155,'Pupil Data Table'!$AB$9:$AB$155,"x"),'Pupil Data Table'!$AJ$2:$AK$25,2,1),"") Blank if error

    or

    =IFERROR(VLOOKUP(AVERAGEIFS('Pupil Data Table'!$J$9:$J$155,'Pupil Data Table'!$AB$9:$AB$155,"x"),'Pupil Data Table'!$AJ$2:$AK$25,2,1),0) zero if error


    Generally,

    =IFERROR(formula, error_Condition)

    Error_condition is typically blank/null/zero but can be (for example) a text string such as "ERROR in DATA"

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Numerical value into text
    By aqlaql in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2015, 08:09 PM
  2. Text to Numerical Value
    By peteuga in forum Excel General
    Replies: 2
    Last Post: 01-26-2011, 04:22 PM
  3. Text to Numerical Value
    By peteuga in forum Excel General
    Replies: 3
    Last Post: 01-26-2011, 03:55 PM
  4. displaying months from cells as their text (not numerical)
    By Xtopher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2009, 07:58 PM
  5. Numerical Value to text
    By no0dles in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 04-25-2006, 10:30 AM
  6. text has numerical values
    By TXEagle in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  7. [SOLVED] text has numerical values
    By TXEagle in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

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