+ Reply to Thread
Results 1 to 12 of 12

Excel formula for using if and different conditions

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    France
    MS-Off Ver
    2016
    Posts
    4

    Post Excel formula for using if and different conditions

    Hi ALL,

    i need to add grades in a cell by comparing score and percentile.

    A GRADE 790-820
    B GRADE 730-780
    C GRADE 660-720
    D GRADE 600-650
    F GRADE 370-590

    If the percentile is greater than 40 AND the score is 660 , the student will get C grade but if score is 660 but percentile is less than 40 student need D grade. How can we use if loop?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Excel formula for using if and different conditions

    No need for IF statements - we can use a lookup. However, how are you calculating the percentile? Are there other percentiles that affect your grade boundaries?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-20-2018
    Location
    France
    MS-Off Ver
    2016
    Posts
    4

    Re: Excel formula for using if and different conditions

    Percentiles are already calculated! no other percentile is affecting grade boundaries

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Excel formula for using if and different conditions

    OK, so where is the C boundary for someone with a percentile below 40, or are you saying that a low percentile can't get higher than a D?

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Excel formula for using if and different conditions

    So let's assume the latter of my assumptions, where a percentile of less than 40 can't get more than a D, try this (score in A1, percentile in B1):

    =LOOKUP(IF(B1<40,MIN(A1,600),A1),{370,600,660,730,790},{"E","D","C","B","A"})
    Last edited by AliGW; 07-20-2018 at 12:30 PM.

  6. #6
    Registered User
    Join Date
    07-20-2018
    Location
    France
    MS-Off Ver
    2016
    Posts
    4

    Re: Excel formula for using if and different conditions

    let me give you an example if a student scores 820 but his percentile score is less than 40 then he wont get grade A he will get grade B.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Excel formula for using if and different conditions

    What if the score is 595 (between categories)?

    What if the score is <370

    What if the score is >820

    Is it ONLY the 40 percentile which affects the grade?

    is it <40 or <=40?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Excel formula for using if and different conditions

    OK, this then:

    =LOOKUP(IF(B1<40,A1-130,A1),{370,600,660,730,790},{"E","D","C","B","A"})

    or this, maybe:

    =IF(B1<40,LOOKUP(A1,{370,600,660,730,790},{"U","E","D","C","B"}),LOOKUP(A1,{370,600,660,730,790},{"E","D","C","B","A"}))
    Last edited by AliGW; 07-20-2018 at 12:44 PM.

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Excel formula for using if and different conditions

    Here's another alternative assuming that a percentile < 40 bumps them down a grade:

    =SUBSTITUTE(CHAR(LOOKUP(C2,{370,600,660,730,790},{69,68,67,66,65})+IF(B2<40,1,0)),"E","F")

    With percentile in B2 and score in C2.
    Last edited by 63falcondude; 07-20-2018 at 12:50 PM.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Excel formula for using if and different conditions

    Maybe??

    =IF(B2<40,LOOKUP(C2,{370,600,660,730,790},{"E","E","D","C","B"}),LOOKUP(C2,{370,600,660,730,790},{"E","D","C","B","A"}))
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-20-2018
    Location
    France
    MS-Off Ver
    2016
    Posts
    4

    Re: Excel formula for using if and different conditions

    Hi,

    the other formula worked I.E (=IF(B1<40,LOOKUP(A1,{370,600,660,730,790},{"U","E","D","C","B"}),LOOKUP(A1,{370,600,660,730,790},{"E","D","C","B","A"}))),

    but the school introduced a new condition now if the student has a percentile higher than 90 and then he will get a higher grade. for example a student score 780 and the percentile is more than 90 so he/she will get A grade instead of B. All the previous conditions are still existing

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,418

    Re: Excel formula for using if and different conditions

    So introduce another IF statement at the start that deals with the high percentiles. You will then have two nested IFs.

+ 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. Excel formula with conditions
    By gusain in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-18-2014, 03:16 AM
  2. Excel formula IF & COUNT.CONDITIONS - how?
    By fafikdog in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 02-14-2014, 07:08 AM
  3. Formula to Substract if Conditions met in Excel
    By bjnockle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2013, 11:07 PM
  4. [SOLVED] Matching 3 conditions excel formula
    By PRADEEPB270 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-18-2013, 01:05 AM
  5. Excel formula for three conditions
    By rathajs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-26-2012, 03:30 AM
  6. COUNTIF Formula in Excel with two conditions
    By Gayla in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-13-2006, 02:10 AM
  7. an excel formula for specific conditions
    By srinivasan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2006, 01:25 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