Split Utility Cost via Fixed & Variable Means

I have seen some posts somewhat similar, but none that address the specific solution I seek.

We need to be able to allocate Utility (Electricity, Water, Gas, etc) to the various Cost Centers. The Charges are all originally paid in the same Cost Center, and that is the only cost going to this Cost Center.

The nature of Utilities is that it is partially variable & partially fixed.

The Fixed portion of the bill will go to the majority of Cost Centers based on Square Footage. Ie $10k monthly to split based on square footage.

The Variable portion of the bill is the remainder of the total of the Cost Center after the Fixed Allocation. We need to be able to allocate this based on the activity of production. Currently we are allocating based on Production Units, but other denominators are possible (Absorbed Cost?) We can’t make things simple, as the Production Units are also weighted depending on the type of unit.

Here is how the postings (manually) are currently being allocated:

Invoice Receipt:

D Cost Element: 1 (Cost)

Cost Center: A $25 (amount varies)

Fixed Allocation: (Same Amount Monthly)

D Cost Element: 2 (Cost)

Cost Center: B $7

Cost Center: C $3

C Cost Element: 3 (Revenue)

Cost Center: A $10

Variable Allocation: (Remainder of Actual - Fixed)

D Cost Element: 2 (Cost)

Cost Center: D $9 (weighted based on Production Units)

Cost Center: E $6 (weighted based on Production Units)

C Cost Element: 3 (Revenue)

Cost Center: A $15

Our business is becoming more complex with additional production lines, so it becomes increasingly more difficult to do a manual allocation. My hope is that there is some solution in SAP that will allow us to perform this allocation automatically.