Formula in Deal Layout Based on the Current Stage

Formula in Deal Layout Based on the Current Stage

On our deals we recieved three bits of revenue:
      - A fee at the start
      - A fee in the middle
      - A commision at the end

When cases are in 'Onboarding' the 'Total Potential Reveune' will be all three figures added together.

When cases are in 'Submitted' the 'Total Potential Revenue' will be the Middle Fee and the Commission.

When cases are in 'Legals' the 'Total Potential Revenue' will just be the Commision

This is a tricky problem for us, which we've solved by having three Formula fields (Onboarded Revenue, Submitted Revenue and Commision).

I'd like to write a formula that looks at the deal stage, and knows which fees are left to be received. I'm guessing there's IF statements that can be used but I keep messing up the syntax. Can anybody help? Pllllllllllleaseeeeee :)