I have this final exam I make available for those students who don't get the final grade good enough.

So, I am trying to make this formula with the IF function that makes different calculation depending of if there is or not a grade in the final exam.

The idea is:

If final exam is bigger than 1. Then do an average of the assign plus the final exam grade and divide the result per 2. Else, just make an average of the assigns.

=IF (Final exam>1, (AVERAGE (Assign 1,Assign 2,Assign 3 ) + Final exam) /2, (Assign 1,Assign 2,Assign 3 ))

In Excel it did work, with the formula =IF(E2>1,(AVERAGE(B2:D2)+E2)/2,AVERAGE(B2:D2)) as can be seen in the attached file.

In Moodle I tried =if(4>1,(average(1;2;3)+4)/2,average(1;2;3)) where 1, 2, 3 is the assigns and 4 is the final exam, but it says the formula is wrong.

Could someone help me figure it out how to make this formula in Moodle?