+ Reply to Thread
Results 1 to 10 of 10

Using data ranges in an IF statement

  1. #1
    Registered User
    Join Date
    08-27-2007
    Posts
    5

    Using data ranges in an IF statement

    hey anyone!

    can anyone help me with my problem?

    I need to be able to give a grade A, B, C or a D by using a range of scores in an IF function for a markbook as part of my IT coursework.

    I have had several failed attempts, and this is one of my many formulas that has failed:

    =IF(O6<45,"D",IF(O6=$46:$60,"C",IF(O6<$61:$74,"B",IF(O6>75,"A"))))

    can anyone tell me what is wrong with it?

    PS. I have attached a screenprint.

    thankyou.
    Attached Images Attached Images

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

    =LOOKUP(O6,{0,46,61,76},{"D","C","B","A"})
    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
    Registered User
    Join Date
    08-27-2007
    Posts
    5

    damnit

    no, sorry that hasn't worked, it still shows every grade as "D".

    I really don't know why, as all the "Overall Percentage Mark" values are different.

    Do you know of any other solutions?

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Could it be that the formula compares o6(60% which is 0.6 ) to 45 ( and not 0.45) which would explain that you alwas get a "D"?

    Try
    Please Login or Register  to view this content.

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

    Are you sure that your calculations option isn't set to manual?

    Check, Tools|Options and go to Calculation tab....the Automatic radio button should be selected.

    or what Arthurbr said...

  6. #6
    Registered User
    Join Date
    08-27-2007
    Posts
    5

    Smile yay!

    Thankyou soo much! that last code worked! My calculations were on automatic by the way.

    thankyou again!

    ell

  7. #7
    Forum Contributor corinereyes's Avatar
    Join Date
    12-02-2003
    Location
    Philippines
    MS-Off Ver
    MS Excel 2016
    Posts
    520
    Hello,

    You are referring to column O with the percentage score on it. Try using column m instead or you can try this formula and paste in P6. . NBVC function is also working in my worksheet.
    Please Login or Register  to view this content.
    Hope that helps.
    Corine

  8. #8
    Registered User
    Join Date
    08-27-2007
    Posts
    5
    no sorry corine, i couldnt use that formula because the grade is for the "overall" mark. And column O, is determined by using a formula from the homework mark (column L) and the exam mark (column N), and column M, is only the exam.

    but thankyou anyway for your support

    ell

  9. #9
    Forum Contributor corinereyes's Avatar
    Join Date
    12-02-2003
    Location
    Philippines
    MS-Off Ver
    MS Excel 2016
    Posts
    520
    Hi elle,

    Thanks for that. I' m glad that we are learning a lot from this forum.

  10. #10
    Registered User
    Join Date
    08-27-2007
    Posts
    5

    thx

    yea thx Corinne Bailey Rae. I don't know a lot about excel either. im startin it for gcse this year.

    ell

+ 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