Help

Re: Need help regarding advanced formula usage

618 0
cancel
Showing results for 
Search instead for 
Did you mean: 
elija6266
4 - Data Explorer
4 - Data Explorer

Hello there,

I am trying to create a formula that calculates the total cost of items based on their quantity and unit price; while also factoring in a discount percentage if applicable. I have tried using nested IF statements; but I am running into some challenges with getting the formula to calculate correctly. 

Here's an example of what I am trying to achieve:

Item A; Quantity = 10, Unit Price = $20, Discount = 10%
Item B; Quantity = 5, Unit Price = $15, Discount = 0%
I want the formula to calculate the total cost for each item taking into account the quantity, unit price, and discount, and then sum up the total cost for all items.

Could someone please guide me on how to structure this formula correctly?

Also, I have gone through this; https://community.airtable.com/t5/formulas/need-help-with-formula/salesforce/149593 and it definitely helped me out a lot.

Any help or insights would be greatly appreciated.

Thank you in advance for your assistance.

2 Replies 2

Try this:

Quantity * Price *
IF(
  Discount,
  1 - Discount,
  1
)

Screenshot 2024-04-22 at 3.21.57 PM.png

How are your tables and fields set up?

One way of doing this is to have a two table system. One table for entire orders, and another linked table for line items. Use a formula like Adam’s to calculate the price for each line item. Then use a rollup field to the main orders table to see the sum for the entire order.