Using Formula with Numbers and subitems Column

Hi Monday Community!

A general request for help creating a formula please. I’m trying to track budgeted hours to complete a task that will automatically subtract from the columns total hours once the task is complete.

The way I have it setup: Within a project phase ‘Concept’, there are various tasks itemized in the subitems column. Each task within the phase has budgeted hours associated. The formula column is in the main project phase that I would like to represent remaining hours within the phase updated as subitems are completed. I’m looking for a formula that will automatically subtract hours budgeted to a line item that have been flagged as ‘complete’ from the phase total hours.

Hope this explanation is clear enough. Thank you!