Project Cost Tracking: Project Codes, Shared-Cost Allocation and Project Margin
The true cost of a project is the sum of several items: materials, labour hours, subcontractors, vehicles and travel, plus a rule-based share of shared costs such as workshop. To see margin, add two more: amounts already ordered but not yet invoiced (open orders) and the project manager’s estimate of the remaining work. A project cost total built in Excel at month end can go quietly wrong in four places: rows with no project code, the same invoice charged in full to two projects, a timesheet in a separate file with typed-in project names, and a hand-made shared-cost allocation nobody can trace.
In the fictional example, a project planned at an 18.75% margin shows 24.8% in Excel and actually runs at 13.2%. Of the 11.6-point gap, 3.5 points come from those four errors and 8.1 from the 520,000-unit open order Excel does not count.
One test tells you whether Excel is enough: for a project that closed last month, can you show from today’s file alone its final cost, which invoice was charged to it at what share, and what its shared-cost allocation was based on? If so, Excel is enough.
What makes up the cost of a project?
Project cost is the total of the costs that belong directly to the project plus a rule-based share of shared costs. A direct cost can be tied to one project through its document; an indirect (shared) cost serves several projects and can only be split with an allocation key.
| Item | Direct? | How it is tied to a project |
|---|---|---|
| Materials | Direct | Project code on the purchase order and invoice |
| Labour hours | Direct | Project line on the timesheet × loaded hourly cost |
| Subcontractor | Direct; split if it serves two projects | Quantities or work items on the subcontractor’s progress claim |
| Vehicles and travel | Usually shared | Vehicle usage log (vehicle-days, mileage), accommodation document |
| Workshop and equipment | Shared | Labour hours or equipment usage log |
The loaded hourly cost is gross pay plus employer contributions and benefits, divided by hours worked; which items go into it is your company’s costing policy. I recommend not allocating general overheads (office, accounting, management) to projects: show each project’s contribution and deduct overhead at company level. That is a management reporting choice; how costs are classified in the accounts belongs to your accountant.
Project code discipline: which project does a cost belong to at the moment it is entered?
A project code should be mandatory at the moment a cost is entered; every row chased with “whose is this?” at month end ends up on the wrong project or on none.
The rules I recommend:
- No blank project code. A cost, timesheet entry or purchase order cannot be saved without a project code. A genuinely shared cost is not entered as “GENERAL” but with a code naming its pool: vehicle pool, workshop pool, general overhead.
- Each pool has a single allocation key. Vehicle costs are allocated by the vehicle usage log (which vehicle was on which project on which day), workshop costs by the labour hours charged to projects. A fixed ratio (for example “P-104 30%”) is used only when no usage log can be kept and the ratio has been approved in writing.
- Finance prepares the allocation and the finance manager approves it; nobody approves the share charged to their own project (roles are in the table below). A project manager’s dispute and its outcome stay on record.
- No new costs on a closed project; the route for late invoices is in the closing section below.
Worked month: 6 projects, 412 cost rows, one variance
The company, projects and figures are fictional; every figure comes from a Python script that checks it. Amounts are in an unnamed currency unit. A machinery installer has 6 open projects; P-098 closed last month. All costs go into one Excel table; labour hours are copied in at month end from a separate timesheet file.
| In Excel at month end | Count |
|---|---|
| Cost rows | 412 |
| Rows with a blank project code | 29 rows, 253,100 units |
| Shared costs entered under “GENERAL” | 46 rows: vehicles 168,000, workshop 123,200, general overhead 39,400 |
| Timesheet hours not matched to a project | 276 of 2,464 (typed-in text such as “conveyor line”) |
| Invoice charged in full to two projects | 1 subcontractor invoice: 240,000, recorded as 480,000 |
The 29 uncoded rows are chased and assigned: 9 to P-104, 17 to other open projects, and 3 are late invoices for the closed P-098, entered without a code because P-098 had left the drop-down list. Vehicle and workshop costs (291,200 in total) had never been allocated in Excel; now vehicle costs follow each project’s share of 120 vehicle-days and workshop costs run at 50 units per hour across 2,464 project hours. The subcontractor invoice is split 40% to P-103 and 60% to P-104 by the quantities on the subcontractor’s progress claim.
P-104 is the installation of a conveyor line. Contract value 6,400,000 units, budgeted cost 5,200,000, planned margin 18.75%. Actual cost in Excel: 2,860,000. The corrections:
| P-104 correction | Amount (units) |
|---|---|
| 9 uncoded rows assigned to P-104 | +74,000 |
| 212 unmatched hours × 750 loaded hourly cost | +159,000 |
| Vehicle share: 38 of 120 vehicle-days | +53,200 |
| Workshop share: 702 hours × 50 | +35,100 |
| Subcontractor invoice reduced to its 60% share | −96,000 |
| Corrected actual | 3,085,300 |
Add a drive unit that has been ordered but not yet invoiced (520,000) and the project manager’s estimate of remaining work (1,950,000), and the estimated total cost reaches 5,555,300. The budget is exceeded by 355,300 (6.8%) and the estimated margin drops to 844,700, or 13.2%. The Excel view shows 2,860,000 + 1,950,000 = 4,810,000 in cost and a 24.8% margin; it ignores the open order and the corrections. The 11.6-point gap splits into 3.5 points from the four errors (+225,300) and 8.1 from the open order. A project that looked ahead of plan is 5.55 points below it.
At month end the project manager reviews the remaining-work estimate, the team checks for a written change order with the client, and only then is the budget revised.
Open orders, progress billing and invoices that arrive after closing
An open order (commitment) is an amount placed with a supplier but not yet invoiced; it does not usually appear in the accounts until the invoice arrives, yet the money is tied up, like the 520,000 drive unit on P-104. I recommend tracking project cost as actual + open orders + estimate to complete; when the invoice arrives, the amount moves from open order to actual and is not counted twice. The budget vs actual expense dashboard applies the same logic to department budgets; the difference here is that the budget is tied to the life of the project, not the year.
Advance payments and progress billing go in the billing and cash line of the project report, not in cost; I recommend keeping them apart in the management report. On P-104 progress invoices so far total 2,880,000, or 45% of the contract. Progress measured by cost is 3,085,300 ÷ 5,555,300 = 55.5%. The 10.5-point gap can come from billing running behind progress on site, a remaining-work estimate that is too low, or material bought early so cost runs ahead of work; the report raises the question, the site answers it. The tax and accounting treatment of progress billing and of multi-year contracts belongs to your accountant.
A budget revision does not overwrite the original budget. The revised budget is stored as a separate version: which item, old and new amount, reason (approved change order, price increase, scope change) and approver.
For invoices that arrive after closing I recommend a two-stage close. At technical close no new orders or hours can be entered, but invoices are still accepted. At financial close the project is locked; an invoice arriving later goes to a “late invoice for a closed project” queue, is added to the project with the finance manager’s approval, and a new version of the project report is produced.
How do you build a project cost table in Excel?
A solid project cost table in Excel uses three sheets: Expenses, Projects and Summary. Columns on Expenses: A Date, B Document no, C Supplier, D Description, E Project code, F Category, G Amount, H Document total (the full invoice), I Status (“Actual” or “Committed”), J Check. Column A on Projects holds the open project codes. On Summary, project codes run down from A2 and categories (Materials, Labour, Subcontractor, Vehicles) run right from B1.
Convert the range with Home > Format as Table (Ctrl+T) so column J fills new rows; link column E to Projects!A:A with Data > Data Validation. In English Excel:
J2 =IF(E2="","No code",IF(COUNTIF(Projects!A:A,E2)=0,"Not in list",IF(SUMIFS(G:G,B:B,B2,C:C,C2)>H2,"Over-allocated","")))
B2 =SUMIFS(Expenses!$G:$G,Expenses!$E:$E,$A2,Expenses!$F:$F,B$1,Expenses!$I:$I,"Actual")
=COUNTIFS(Expenses!J:J,"No code")
Column J shows “Over-allocated” when rows with the same document number and supplier exceed the full invoice: the example’s subcontractor invoice, charged at 240,000 to two projects, totals 480,000 and both rows are flagged. A legitimate split (an invoice of 30,000 charged as 18,000 and 12,000 to two projects) is not flagged. On Summary, add a second block with the last criterion changed to “Committed”. Watch the argument order: according to Microsoft’s SUMIFS page (2026-11-01), the order of arguments differs between SUMIFS and SUMIF; the sum range comes first in SUMIFS, so a formula adapted from SUMIF sums the wrong thing without warning. I tested the formula logic in the script with uncoded rows, unlisted codes, a double-charged invoice and a legitimate split; I did not open them in Excel.
Where does Excel break?
The formulas flag; they stop nothing. According to Microsoft’s invalid data page (2026-11-01), data validation only works when data is typed into a cell; copied or filled values get through, which is how month-end pastes arrive.
| In Excel | In the app to be built |
|---|---|
| Project code can be left blank; “No code” shows at month end | A record will not save without a code |
| An over-allocated invoice is flagged but still counted | A record will not be finalised if allocations exceed the document total |
| Timesheet in a separate file, project name typed in | Hours will be entered by picking from the open project list |
| Shared-cost allocation by hand; the key used cannot be traced | The key and source records (vehicle-days, hours) will be stored with the allocation |
| A closed project drops off the list, so late invoices stay uncoded | Late invoices will go to a separate queue and be added on approval |
Who enters, who allocates, who approves?
Entering costs, calculating the allocation and approving it should sit with different people; when one person holds all three, the allocation can drift towards their own project unnoticed. The role set I recommend:
| Role | Enters | Sees | Approves | Cannot |
|---|---|---|---|---|
| Site supervisor | Hours, site expenses | Own project | — | Enter an uncoded record |
| Purchasing | Orders (open orders) | Orders | — | Change invoice amounts |
| Project manager | Remaining-work estimate, disputes | Own projects | Hours on own project | Approve allocation shares |
| Cost accountant | Invoice matching, allocation run | All projects | — | Approve own calculation |
| Finance manager | — | All projects | Allocation, late invoices, financial close | Silently change a closed report |
| Managing director | — | Project summary | Budget revisions | — |
In the app to be built, site supervisors and project managers see only project totals and hour counts; the per-person loaded hourly cost is visible only to the cost accountant and the finance manager. Amounts are tracked excluding VAT; adding non-recoverable VAT to project cost is a separate policy decision.
In the app to be built, every change leaves a trace: moving an approved cost records old and new project, reason, person and time; a correction after month close produces a new report version.
What does AI suggest, and what does it not decide?
In this workflow AI suggests matches; it does not make cost decisions. Suggestions that can be built in: matching “conveyor line” on the timesheet to P-104, proposing a project and category from an invoice description, matching an incoming invoice to an open order, and flagging the same invoice sitting in full on two projects. A suggestion does not enter a project total until a user approves it; AI does not set the allocation key, the remaining-work estimate or a budget revision. The scope will require that no row reaches the model without passing the permission filter; which AI provider may receive contract and pricing data is also set in writing, and without that permission the feature is not used.
Excel, an ERP project module or a web app?
Decide by whether the system you use today answers three questions: can a cost be entered without a project code, is each shared-cost share shown together with the record it was calculated from, and do open orders count towards project cost?
If all three answers are yes, your current system is enough. For each no, take the first option below, listed cheapest to costliest, that closes the gap.
| Option | When | Limit |
|---|---|---|
| Excel: Expenses + Projects + SUMIFS summary | Few projects; one person enters costs and allocations | Flags but does not stop; hours and allocation stay in other files |
| Project or cost-centre dimension in the accounting software | Invoices are already there and actuals are enough | Open orders, remaining-work estimates and hours often sit outside |
| ERP project module | The module exists, the team uses it, your rules fit it | Site staff need user accounts and licences; non-standard rules are hard |
| Custom web app | Many people enter data; hours and allocation must link to records | Written scope, server, maintenance |
If your ERP’s project module covers open orders, time entry and allocation and your team actually uses it, do not spend money on a custom app; a missing report usually takes less effort to build in the ERP’s reporting tool or in Excel from an export. A custom app makes sense when site staff have no ERP accounts, timesheets and allocation keys live in separate files, several project managers should each see only their own projects, and your closing and late-invoice rules are your own. The app does not replace accounting records; invoice data can be taken from your accounting software’s export (the format is set in writing once I see the software), and project cost is shown as a management report.
What scope can be developed?
On top of the rules above, a project record (contract value, approved changes, budget versions), order-to-invoice matching, time entry, the allocation run and a project margin report can be developed. It can be built to your needs, with the scope set in writing at the first step. The server (a VPS) can be opened in your company’s name. The data is yours and can be exported to Excel or CSV at any time. For small and mid-sized teams there is no per-user licence; the cost is the server and maintenance. The source code sits in a repository you have access to, with run instructions, a dependency list and known limitations. My general way of working is on the custom web apps for your team page.
The first meeting is paid. Bring the cost breakdown of one closed project and your timesheet column headings, and we start with the scope: contact page.
Frequently Asked Questions
How are hours entered when a crew works on two projects in one day?
In the app to be built, time entry will allow several project lines in one day: 3 hours on P-103 in the morning and 5 hours on P-104 in the afternoon, for example. If one person’s daily total exceeds the shift length, the entry can go to overtime approval. Whether travel time goes to the destination project or the vehicle pool is fixed as a written rule at the first step.
Which exchange rate applies to a project cost ordered in a foreign currency?
In the app to be built, the rate at the time of ordering is kept on the open order and the invoice rate on the actual; the difference shows as a separate line instead of blending into the cost. Which rate is the basis and whether exchange differences are charged to the project or the company is your costing policy; ask your accountant about the accounting entry.
Will it clash with the project codes in our accounting software?
The project code list lives in one place: read from your accounting software, or created in the app and exported with the same code. The source is chosen after seeing your software’s import and export formats; I do not say “it connects” before seeing it.
How do I work?
Work-hour packages
Tell me about your business and what you need on WhatsApp or by phone; we agree on a work block of somewhere between 5 and 40 hours and I start doing what is needed. What you get is not a calendar window — it is net working hours spent directly on your business. I can use 40 hours working three days straight, or deliberately spread it out and finish it over a year — whatever the work calls for. I do not spend my time estimating how long something will take, I spend it doing the work; every hour I spend leaves a lasting result in your business. We keep going for as long as you find it useful.
Why not monthly?
Is 40 hours a week?
On a fixed monthly fee both sides are watching the wrong thing: you watch a fixed cost, the other side watches how many more contracts like this they can line up. Working by the hour puts us both in front of the same thing — the real value of the work that got done. I know not having an upfront answer to "how much will this cost in total?" is the natural cost of this model. But instead of paying a fixed fee for months to a setup that is not producing results, you only pay for the qualified time spent on your work — and you see exactly where that time went, start to finish. That is why my clients keep coming back.