For those watching at home:
The solutions above used IF statements—codespeak for “if…then.” You may see them in other applications (e.g., SQL, PHP) as IFF or some other variant—they tend to work on the same principles. Here’s how they (generally) work:
There are four sections to the statement. “IF( …) starts it off and tells the cell that it needs to check for a condition. There are three sections inside the parenthesis (sometimes two). Commas tell the function when you’ve come to the end of a section (if a comma is part of a section, some languages allow you to “escape” that comma so it doesn’t get treated as a section break).
The first section tells the function what to test the condition on. In Laughing Lagomorph’s solution, FIN>MID says to point to the cell with the final grade and see if it’s greater than the midterm grade. Hence, his(?) B2>A2 assumed the final grade was in cell B2 and the midterm grade was in A2. You can set up all sorts of calculations and whatnot in the condition. In general, the formula you put in the first section will either be true or false (i.e., if the final grade is higher than the midterm, the expression is true, if it’s lower than the midterm grade, it’s false.
The second and third sections tell Excel what to do. The second section tells Excel what to do if the statement is true. Since the OP wanted the final grade to be the course grade if the condition was true, then merely referring to the cell (B2) accomplished that. Note that in this (and the third) section, you can put in anything you like, from a text string “keep the final grade” to another formula or even another IF() statement.
The thirds section is simply what you want the function to do if the condition is false. In this case, it takes the average of the appropriate cells. Again, this can be anything you want it to be. Some conventions allow you to skip the third section. In that case, it will only do what you tell it to do in the second section, or else it will do either nothing or move on to the next programming line.
Things can get a bit more complicated, say with an if…then…else, or by nesting if statements inside of the sections. You can start with the simple “if it is raining, then we will go to the museum, else we’ll go to the beach.” (Three sections, a condition, what happens when the condition is true, and what happens if the condition is false.) And add and add and add. “If it is raining, then if the museum is open and if we have the money, we’ll go to the museum, else we’ll go to an ATM to get cash…). These are fairly simple to build, the thing to be careful with is watching the parenthesis and comma placement so you keep track of what conditions are being evaluated at the time.
I have no idea why I was compelled to write all this out. Perhaps it’s because I search the boards all the time and sometimes want to know what’s going on in some of the technical threads. I hope I haven’t added confusion or mucked up the explanation!
Rhythm