Scenario for calculation

Is there any formula instead of first occurance

Answers