# Calculate Remaining Spent on a budget list

Goal: Trying to calculate remaining spent on a budget list where item expenses are grouped per object code. Every object code has a fixed amount of money against which the item expenses are deducted.

Example:

```Object code ABC = 100,000
Item 1 = \$50000
Item 2 = \$30000
Remaining Spent = 100,000 - 50,000 = 50,000
50,000 - 30,000 = 20,000
```

I have 2 lists. One with object codes and their assigned budgets. Another list with item details.

Challenge: How do I deduct expenses from the total amount per object code for every item's actuals?

Level: I am looking for a out of the box solution. Thank You!

• I guess OOTB it is not possible. you have to go for other options – Gaurravs Nov 23 '15 at 19:02
• What other options are you thinking of? Are there any workflow options? – Gayathri Kumar Nov 23 '15 at 20:31
• Can u provide more info? what do you want to do with this remaining amount, display somewhere, or just store in list? Is the amount used in an item is gonna change? – Gaurravs Nov 26 '15 at 14:01
• Can you provide how are you planning to create the 2 list. It might help in providing the solution. – Monica Jagani Nov 18 '16 at 6:44

List 1 : Planned

``````Object Code | Budget | Pending Budget
A           | 10000  | 10000
B           | 20000  | 20000
B           | 30000  | 30000
D           | 40000  | 40000
E           | 50000  | 50000
F           | 60000  | 60000
``````

List 2 : Actual

``````Planned Object Code | Actual
A                   | 1000
B                   | 2000
C                   | 500
D                   | 100
A                   | 1500
A                   | 500
B                   | 1000
C                   | 100
``````
1. List : Planned - Set Pending Budget = Budget initially
2. Set SharePoint designer workflow 2013 on List 2 - Actual.
3. For each new item in Actual - Get value of 'Planned Object Code' in a variable.
4. Based on 'Planned Object Code 'variable, get value of 'Pending Budget' from List 1 corresponding to Object code.
5. Subtract the List 2 - Actual value from 'Pending budget' variable.
6. Update List 1 - Pending budget column value