How to Create a Calculated SharePoint Column for Item Costs
Question details
The user needs to calculate an item cost in a SharePoint list by dividing the total package cost by the number of associated items, ensuring the value updates dynamically when the item count changes.
- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Managing inventory, packages, or distributed costs within a SharePoint list where item quantities frequently change.
- Observed behavior
- SharePoint calculated columns cannot natively aggregate data from related list items or recalculate values dynamically based on related item counts.
Ensure you have the necessary permissions to edit your SharePoint list settings and sufficient access to create workflows in Microsoft Power Automate.
Use Power Automate to Calculate and Update Item Costs
Since SharePoint calculated columns cannot automatically aggregate related list items, you must use a Power Automate flow to perform the calculation and update the list.
SharePoint's native calculated columns are strictly limited to performing calculations on fields within the same item. To divide a total package cost by a dynamic count of related items from another list or grouping, an automated workflow is required.
Open Microsoft Power Automate and create an 'Automated cloud flow' that triggers when a related item is created, modified, or deleted in your SharePoint list.
Add an action to get the main package item from your SharePoint list so the flow can access the total package cost field.
Add a 'Get items' action pointing to the related items list, using an OData filter query to fetch only the associated items. The length of this output will give you the current item count.
Insert a 'Compose' action and write an expression using the div() function to divide the total package cost by the item count.
Add an 'Update item' action to write the calculated value back to the item cost field in your main SharePoint list.
Manage Costs and Data Locally with WPS Office
While SharePoint lists require complex Power Automate flows for dynamic calculations, managing your inventory and package costs in a spreadsheet is far more straightforward. WPS Office provides a powerful, lightweight alternative to Microsoft Office, allowing you to easily handle dynamic calculations, aggregate data, and track costs without building complex automated workflows.
- 1. Export your SharePoint list: In SharePoint, use the 'Export to Excel' feature to download your current list data as a query file or CSV.
- 2. Open data in WPS Spreadsheet: Launch WPS Spreadsheet and open the exported file to view your data in a familiar, user-friendly grid.
- 3. Apply dynamic formulas: Select the item cost column and enter a formula like =A2/COUNTIF(C:C, D2) to instantly and dynamically calculate costs across all your items.

Frequently Asked Questions
Why can't I use a standard calculated column in SharePoint for this?
SharePoint calculated columns can only reference other columns within the exact same row (item). They do not support lookup fields, cross-item references, or aggregating counts from related items in other lists.
Can I use SharePoint Designer to update the item cost?
While older versions of SharePoint supported SharePoint Designer workflows for these types of operations, Microsoft has deprecated them in Microsoft 365. Power Automate is now the required tool for custom list automations.
How do I ensure the cost updates automatically when a related item is deleted?
In your Power Automate flow, you must include 'When an item is deleted' as one of your triggers. This ensures the flow runs, recounts the remaining items, recalculates the cost, and updates the parent package item accordingly.




