# How do I do a gross profit calculation from Pipedrive deals and product costs from within my Zap?

• 206 views

Hi there.

We are currently using Pipedrive as our new CRM system, and have created a custom field called “gross profit” which should be a calculation of.

Gross profit = Net profit - cost of products.

When connecting pipedrive and Zapier i am able to retrieve the Deal Summary (total price) of a deal. And i am also able to retrieve the cost of the associated products. For example 1000,1000,5000,300
Those values should be used for making a calculations:

1000 + 1000 + 5000 + 300 = 7300.

And after that i can make the Gross Profit calculation:

Gross profit = Net profit (Summary / total price) - the calculation.

But i am having trouble on how to take the numbers, and divide them and thereby making the calculations.
Can someone help on this issue?

Hi @Two Wheel Company!

The Formatter by Zapier app can handle this for you. You’ll need to add a Formatter by Zapier step into your Zap, make sure to add it at some point before the step where you’ll need the Gross Profit.

If you already have the total from the summary and just need to divide it by the total price, you could us the Formatter function ‘Perform Math Operation’

If you need to add the value of the retrieved products together and then divide that, the best function to use is the ‘Spreadsheet-style Formula’ function. which allows you to add information from previous steps into a formula:

I hope that all makes sense, please let me know if you have any questions!

Userlevel 7
+12

Hi @Two Wheel Company!

The Formatter by Zapier app can handle this for you. You’ll need to add a Formatter by Zapier step into your Zap, make sure to add it at some point before the step where you’ll need the Gross Profit.

If you already have the total from the summary and just need to divide it by the total price, you could us the Formatter function ‘Perform Math Operation’

If you need to add the value of the retrieved products together and then divide that, the best function to use is the ‘Spreadsheet-style Formula’ function. which allows you to add information from previous steps into a formula:

I hope that all makes sense, please let me know if you have any questions!