At 09:14 23/10/2008 +1100, Hedley Finger wrote:
I am grading assignments. There is a 5 percent penalty per day for late submission. So I want to subtract the deadline date from the actual submission date, and if the answer is positive, calculate 5 percent of the grade and subtract that value from the grade.

I can do most of it if I drink a gin or two. But the tricky bit is "So I want to subtract the deadline date from the actual submission date, and if the answer is positive". Can anyone tell me how to do a conditional branch on the result of the subtraction (or take-away, for those of you who only understand the higher maths)?

Suppose you have the submission dates in column A, the raw grades in column B, and the deadline date (I'm assuming it will be a single value) in G1. The simplest formula I can produce would be:
     =B1*(1-MAX(A1-G$1;0)/20)
- which you can fill down a column. The MAX() function takes the larger of the lateness in days and the value zero: in other words, it preserves positive values but rejects negative ones, replacing them with zero. Then it's a simple task to subtract 5% (a twentieth) of the raw value for each of those late days.

Note that this formula will continue to subtract for delays over twenty days, resulting in negative reduced grades. If you intend to accept assignments more than twenty days late but wish the reduced grades to bottom out at zero, you will instead need something like
     =B1*MAX((1-MAX(A1-G$1;0)/20);0)

Oh, and all that was with no gin, in fact.

I trust this helps.

Brian Barker


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to