Hi guys,
I have a billing sheet, looks roughly like the one below. At the bottom of the cost column is a total that tells me how much to bill a client for a particular job, based on the hours worked and the cost of those hours. However, if any individual does more than 80 units of work on a given day, the maximum we can charge is for 80 units. Is there a formulae i can use to calculate from this list the actual amount i should bill? In the case below the bill would be for 72y and 80x even though there are 86x units accrued by Joe. If it cannot be done as a formulae then a macro would be appreciated also
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Units[/TD]
[TD]Unit Cost[/TD]
[/TR]
[TR]
[TD]Joe Bloggs[/TD]
[TD]25/6/16[/TD]
[TD]25[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Joanne Smith[/TD]
[TD]25/6/16[/TD]
[TD]72[/TD]
[TD]y[/TD]
[/TR]
[TR]
[TD]Joe Bloggs[/TD]
[TD]25/6/16[/TD]
[TD]61[/TD]
[TD]x[/TD]
[/TR]
</tbody>[/TABLE]
I have a billing sheet, looks roughly like the one below. At the bottom of the cost column is a total that tells me how much to bill a client for a particular job, based on the hours worked and the cost of those hours. However, if any individual does more than 80 units of work on a given day, the maximum we can charge is for 80 units. Is there a formulae i can use to calculate from this list the actual amount i should bill? In the case below the bill would be for 72y and 80x even though there are 86x units accrued by Joe. If it cannot be done as a formulae then a macro would be appreciated also

<tbody>[TR]
[TD]Name[/TD]
[TD]Date[/TD]
[TD]Units[/TD]
[TD]Unit Cost[/TD]
[/TR]
[TR]
[TD]Joe Bloggs[/TD]
[TD]25/6/16[/TD]
[TD]25[/TD]
[TD]x[/TD]
[/TR]
[TR]
[TD]Joanne Smith[/TD]
[TD]25/6/16[/TD]
[TD]72[/TD]
[TD]y[/TD]
[/TR]
[TR]
[TD]Joe Bloggs[/TD]
[TD]25/6/16[/TD]
[TD]61[/TD]
[TD]x[/TD]
[/TR]
</tbody>[/TABLE]