On fly:
Code:
=MAX(value2 - value3, (value2-DLookup("Value4","YourTable","Date = #" & DMax("Date","YourTable", "Date < #" & [Date] & "#" ) & "#")), (DLookup("Value4","YourTable","Date = #" & DMax("Date","YourTable", "Date < #" & [Date] & "#" ) & "#") - value 3))
But probably this returns error for 1st row too as Micron mentioned. Without Access available at weekend, I haven't tools to check the formula and possible workarounds.
And probably the best solution will be an UDF designed specially for this case - there you can have solution for 1st row exactly in a manner you want.