# SUM formula with Lookup Values

**URL:** <https://community.baserow.io/t/sum-formula-with-lookup-values/4184>\
**Category:** Baserow Help\
**Tags:** formula\
**Created:** [December 24, 2023, 12:03pm UTC](https://community.baserow.io/t/sum-formula-with-lookup-values/4184 "2023-12-24T12:03:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pinshasa](https://community.baserow.io/user_avatar/community.baserow.io/pinshasa/32/3027_2.png) [@Pinshasa](https://community.baserow.io/u/Pinshasa)\
**Post date:** [December 24, 2023, 12:03pm UTC](https://community.baserow.io/t/sum-formula-with-lookup-values/4184/1 "2023-12-24T12:03:54Z")

</div>

Hello,

I’m building a quote generator.

It has an Order table and an Order Items table.

Each Order Items has a quantity and a price, and a formula field that calculates the Total price for the quantity.

In the Order table I need the sum of all Total prices from the Order Items linked to the Order record.

The sum(lookup ‘table reference’, field reference’) does not work if I use the formula field from the Order Items table. It does not recognize the numbers as such.

If I write these numbers manually in another field, it works.

If I use the tonumber formula on the Total formula field, it says that this is already a number.

Therefore my question: do I need to rewrite manually every number if I want to make a sum(lookup) formula in a linked table, or is there something I’m doing wrong?

Thanks in advance,

Maxime

---

<div class="post-metadata">

**Author:** ![frederikdc](https://community.baserow.io/user_avatar/community.baserow.io/frederikdc/32/2086_2.png) [@frederikdc](https://community.baserow.io/u/frederikdc)\
**Post date:** [December 26, 2023, 5:26am UTC](https://community.baserow.io/t/sum-formula-with-lookup-values/4184/2 "2023-12-26T05:26:37Z")

</div>

Hi,

You can have a look at the [Beverage Sales Management // Baserow](https://baserow.io/templates/beverage-sales-management) template. It also has a table for Orders and Order details and uses rollup functions to calculate the total price for each order.

Regards  
Frederik
