Having a problem figuring out correct formula

Occasional Visitor

Having a problem figuring out correct formula

I am working on a template that tracks labor for contract workers.  It tracks daily hours, and totals regular hours and OT hours for each week, and also totals the costs each week (hours * reg rate, hours *OT rate).  And each week, the hours are charges to a project ID.

The total costs, and project ID are on the same line, and there might be multiple contractors charging their time to the same Project ID.

I have over 70 contractors that I'm tracking labor for.

I need a formula that will pull in the total costs for the week ending worked, based on the Project ID.

example - Jane Doe (Column A - Reg Hours, Column B - OT Hours, Column C - Project ID), John Doe (Column D - Reg Hours, Column E - OT Hours, Column F - Project ID), Sally Lu (Column G - Reg Hours, Column H - OT Hours, Column I - Project ID).

Jane Doe and Sally Lu are charging to the same Project ID, but John Doe is not.  I need the formula to sum based on week ending, and Project ID.

Can anyone help??  I haven't been this stuck on a formula in quite a while now.  I would appreciate any help!