+ Reply to Thread
Results 1 to 5 of 5

How to combine results of several if clauses in one formula?

  1. #1
    Registered User
    Join Date
    05-30-2013
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    2

    How to combine results of several if clauses in one formula?

    Hello,

    I am making a grading spreadsheet for my students. The students will receive extra points based on the number of exercises the have done. The amount of these points will be based on these conditions:

    -A student must do at least 60 exercises to pass (they are short ones and the course is long, this ain't a tight condition ). If this condition is not met, I want the excel to show how many he/she is lacking.
    -If a student has done 80 exercises or more, he/she receives 1 extra point.
    -If student has made 100 exercises or more, he/she receives 2 extra points.
    -Additionally, the student who has done the greatest number of exercises gets 1 extra point more.

    I have the following excel formula:

    =IF(AA3>=100;2;IF(AA3>=80;1;IF(AA3>=60;0;(AA3-60))))+IF(AA3=MAX(AA3:AA22);1;0)

    The first part is working nicely, but it doesn't do anything about the second part. Separately both if clauses function as they should, but I can't combine them.

    Of course I could make 3 columns - 1st for the base point calculation, 2nd for max point calculation and 3rd where to calculate the sum (that's what I did now ). But for future it'd be nice to know if there is a convenient way to add the results of several if clauses together using a single formula.

    Anyone have a nice and simple solution?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: How to combine results of several if clauses in one formula?

    Hi and welcome to the forum

    It looks like it should work, but without having any data to test it with, I cant say for sure

    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-30-2013
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to combine results of several if clauses in one formula?

    Well, now I feel like an a**. I just noticed that the latter part is not functioning even separately. I added $'s inside the MAX clause and now it's working like a charm. So, it seems to be ok to add results of IF clauses together in one formula.

    Sorry, lack of sleep seems to have its effects. (And I still have 35 exams to grade before morning... )

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: How to combine results of several if clauses in one formula?

    I don't see anything wrong with the second part of your formula.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: How to combine results of several if clauses in one formula?

    Im happy you solved it, it sometimes help to step back and explain wjhat's happening, to help you see the problem

    (if you had said it works sometimes and not others, the missing $ would have been a give-away)

    Please mark this thread solved, see 2 below

+ 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