---
title: "Basic calculations using the formula column"
description: "Basic calculations using the formula column"
url: https://help.stackby.com/en/articles/116-basic-calculations-using-the-formula-column
collection: "Formulas"
updated: 2025-01-20
language: en
---

# Basic calculations using the formula column

Basic calculations using the formula column

In Stackby formulas are slightly different from traditional spreadsheet programs like Excel or Google Sheets. 

In a spreadsheet, you can put a formula in any cell, and have it reference any other cell in the sheet. But Stackby is a relational database so formulas are applied for the entire column so that the same formula applies to every row in that column.

**1\. Adding**

You can add multiple columns together by separating them with a + sign.

Here is the simple example of adding 3 subject marks. In the formula column you can write such   
**Formula:**

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/f282e96b43399449abead574e42b3bee8a36a38bb1ac62b600e8e3cbb10971891657184289229.png)

 **Result:**

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/7cf8b568af8454a7b770e6adedc491ea1d8f8b7bebdf4e738d6239f55361b6371657184544441.png)

**2\. Subtracting**  
You can accomplish similar calculations using the same formula structure. To find the difference between wages due and wages paid, you would use a formula like the following: 

**Result:**

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/8890c369a831e1c5032b2211efd8e6ff93990033a4d20a3c20b7cd98fd6b3db11657185980407.png)

**3\. Multiply**  
For example, if you want to calculate the total wages. You'll need a column hours worked, another to hours wages both are number type, and a Total wages to enter as a formula. 

**Formula** :

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/306d55bf7cc9514e3218db34ed34f762fc90d7ad9f3198c49832e782f81740111657187919115.png)

**Result:**

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/9ef88a42d716233ad0e7e4bddf04796ffb26da90c14ebf261b45f6579f8e01491657187958781.png)

**4. Dividing**

We can use the divide function in Stackby. Suppose if we want to find per hours wages then we can calculate it by total wages divided by No. of hours worked.

**Formula**:

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/59ba0d877c807b3b15c47ad278b6981ddfb483747dbe692dc66751a57e34a2b51657188062225.png)

**Result:**

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/1132300e694cdf5e37f8542b580c85e2c733e22a3c8e725f62811aac14f731ed1657188316133.png)

**5. Add, subtract, multiply, and divide in one formula**

You can add, add, sub, divide within the same formula. In the below example, we can calculate the final amount to charge a client on a payment plan:

**Formula**:

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/2b6a611156a6df2e81850c8fef5439173025f556a245179ab17212943fd6a83c1657188378701.png)

**Result:**

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/9a865378756f37a027fed586c7239d51aa53e2105c4cae25a5902d21293926331657188425120.png)

**6. Formatting a formula field**

In the above example, if you want to do formatting then, you can apply the following formatting to the output of your formula: 

Formatting in any of

-   Integer
    
-   Decimal
    
-   Percent
    
-   String
    
-   Date
    
-   Currency
    

![](https://d258lu9myqkejp.cloudfront.net/attachment_images/b72b397ba63a57560b529a955cdd4dd6dc00c8b0254d63b37deb050afb919a16formatting%20formula.png)
