Formula syntax reference
6 min read
Available variables
costpricecompare_at_priceshipping_costpackaging_costOperators
+cost + 5-price - 10*cost * 2.5/cost / 0.6%price % 10Functions
round(x, n)round(cost * 2.5, 2)ceil(x)ceil(cost * 2.5)floor(x)floor(cost * 2.5)min(x, y)min(cost * 2, 99)max(x, y)max(cost * 2, 19.99)abs(x)abs(price - cost)Conditional expressions
Use ternary syntax for conditions:
``
condition ? value_if_true : value_if_false
`
Examples:
`
cost < 20 ? cost * 4 : cost * 2.5
cost > 100 ? cost * 1.8 : cost * 2.2
`
Conditions support: <, >, <=, >=, ==, !=, &&, ||
Common formula patterns
Simple markup:
`
cost * 2.5
`
Gross margin target (40%):
`
cost / (1 - 0.40)
`
Full cost stack with target margin:
`
(cost + shipping_cost + packaging_cost) / (1 - 0.40)
`
Tiered markup by cost range:
`
cost < 10 ? cost * 4 : cost < 50 ? cost * 3 : cost * 2.2
`
Price floor — never price below $19.99:
`
max(cost * 2.5, 19.99)
`
Price cap — never price above $499:
`
min(cost * 2.5, 499)
`
Error messages
, price, etc.Ready to try it?
Add BulkOps to your Shopify store — free plan available, no credit card required.
Add to Shopify — FreeWas this article helpful?