+ Reply to Thread
Results 1 to 9 of 9

If condition Help

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    If condition Help

    Hello,

    I have attached a sheet explaining my output requirement which is based on grades of a course.

    Please check and suggest

    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If condition Help

    Perhaps..

    =IF(H6=MAX(E6;F6;G6;H6;I6);"A";IF(J6<60;"F";IF(AND(J6>=60;J6<=64);"D";IF(AND(J6>=65;J6<=74);"C";IF(AND(J6>=75;J6<=79);"B-";IF(AND(J6>=80;J6<=89);"B";IF(AND(J6>=90;J6<=94);"A-";"A")))))))
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: If condition Help

    hi gokzee, you could actually make your IF formula much shorter without using AND, because the IF eliminates parts by parts:
    =IF(J6<60,"F",IF(J6<=64,"D",IF(J6<=74,"C",IF(J6<=79,"B-",IF(J6<=89,"B",IF(J6<=94,"A-","A"))))))
    that means if J6 is LESS than 60, it will immediately show you "F". it won't go on to do other tests. if J6 is NOT lesser than 60, it will test if it's lesser or equals to 64. and so on.

    but you could shorten it even further with a table of the minimum values to get the grade & the grade itself lined up like this. say in Q12:R18
    0 F
    60 D
    65 C
    75 B-
    80 B
    90 A-
    95 A
    then:
    =LOOKUP(J6,$Q$12:$Q$18,$R$12:$R$18)
    if you don't want the table, then simply hard code it:
    =LOOKUP(J6,{0;60;65;75;80;90;95},{"F";"D";"C";"B-";"B";"A-";"A"})

    not sure if this is your requirement. i'm guessing if the value in column H is the max, then the person will get "A-" regardless what he gets for column J?
    =IF(H6=MAX($H$6:$H$15),"A-",LOOKUP(J6,$Q$12:$Q$18,$R$12:$R$18))

    so the only person affected is Martin?

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Re: If condition Help

    hiiii,

    i guess u got it wrong...

    the highest grade in column H will get "A-".

    for ex: if te student gets b and if thats the highest, then final will be "a-"

    and if student gets A, then final will be "A" itself.

    hope u got it now

  5. #5
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Re: If condition Help

    Yess...u got it right now!!!

    but if we use max...what happens when the column H actually has high value that corresponds to "A"

  6. #6
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Re: If condition Help

    with the present formula, student who is eligible for "A" will also get "A-".

  7. #7
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Re: If condition Help

    so we need to put in one more if condition that checks if the grade is less than 95 in column H and the max ..then grade will be "A-"

  8. #8
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: If condition Help

    that was what you mentioned in the file?
    Thehighest mark in paper will automatically get A- no matter what other grades are.
    to help us understand better, type out the desired answers manually. ideally, it should have different scenarios you are expecting. try this
    =IF(AND(H6=MAX($H$6:$H$15),J6<$Q$18),"A-",LOOKUP(J6,$Q$12:$Q$18,$R$12:$R$18))

  9. #9
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Re: If condition Help

    The formula Works!!

    Thanks a lot

+ 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