Hi,
The formula you seek will consist of a couple of nested IF functions, but before you can get your teeth into it you will need to establish the rules far more precisely than you have published. Start by fixing the lunch break, perhaps at the top of your sheet, say,
From 11:30 To 13:30.
Now your formula should express the following: Deduct 30 minutes (but not more than the total) from the time the employee was present during the lunch break.
Now, that should be a lot easier if your lunch break wouldn't last for more than 30 minutes, a fact I do not know.
I think you should also take the facts on the ground into consideration. For example, some one punches in 10 minutes before the end of the lunch break. By the above formula he wouldn't get paid for those 10 minutes even though he didn't use them to have lunch. As a result no one likes to show up before "paid" time. But such thoughts wouldn't be necessary if the factory would shut down during the lunch break so that no one can work anyway, and there are other rules in place that prevent people from arriving late because they don't want to be early.
So, the hard part isn't the formula. It's the rules.

Have a great day!

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)