# How to make column 2 - column 3 = column 4

**URL:** <https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839>\
**Category:** Ask for Help\
**Created:** [August 24, 2024, 2:51pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839 "2024-08-24T14:51:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![TTC56010](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TTC56010](https://community.glideapps.com/u/TTC56010)\
**Post date:** [August 24, 2024, 2:51pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/1 "2024-08-24T14:51:20Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/d/ed7ea8e4926e8e0a449d67a7dbb086646a799c19.jpeg)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 24, 2024, 3:33pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/2 "2024-08-24T15:33:48Z")

</div>

I suspect that you are looking for the Math column.

> **[Math Column | Glide Docs](https://www.glideapps.com/docs/automation/computed-columns/math-column)**
>
> Perform instant calculations using the data in your app.

If that doesn’t get you what you need, please elaborate on your question.

---

<div class="post-metadata">

**Author:** ![TTC56010](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TTC56010](https://community.glideapps.com/u/TTC56010)\
**Post date:** [August 24, 2024, 4:54pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/3 "2024-08-24T16:54:53Z")

</div>

> [@Darren\_Murphy](#):
>
> elaborate

no i want Deposit withdraw and balance system

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 24, 2024, 5:17pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/4 "2024-08-24T17:17:48Z")

</div>

So you want a running total?

---

<div class="post-metadata">

**Author:** ![TTC56010](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TTC56010](https://community.glideapps.com/u/TTC56010)\
**Post date:** [August 24, 2024, 5:18pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/5 "2024-08-24T17:18:41Z")

</div>

yes pls

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 24, 2024, 5:20pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/6 "2024-08-24T17:20:27Z")

</div>

You can use a Query column. The below video shows the general technique:

https://www.loom.com/embed/042be3be13004355b0dedec1be67b400

[https://www.loom.com/share/042be3be13004355b0dedec1be67b400](https://www.loom.com/share/042be3be13004355b0dedec1be67b400)

---

<div class="post-metadata">

**Author:** ![TTC56010](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TTC56010](https://community.glideapps.com/u/TTC56010)\
**Post date:** [August 24, 2024, 5:33pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/7 "2024-08-24T17:33:36Z")

</div>

i don’t get it man that a lot of column i have only 4 can you  
teach me or just show easier way

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 24, 2024, 5:47pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/8 "2024-08-24T17:47:48Z")

</div>

That is the easiest way, unless you want to write some code.

---

<div class="post-metadata">

**Author:** ![TTC56010](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TTC56010](https://community.glideapps.com/u/TTC56010)\
**Post date:** [August 24, 2024, 5:51pm UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/9 "2024-08-24T17:51:26Z")

</div>

i have this code how do i use it  
function myFunction() {  
var ss = SpreadsheetApp.getActiveSpreadsheet()  
var sh = ss.getSheet()[0]  
var carry  
var row = sh.getLastRow()  
var last = sh.getLastRow()-1

var deposit = sh.getRange(row,2).getValue()//ฝากเงิน  
var withdraw = sh.getRange(row,3).getValue()//ถอนเงิน  
var amount = sh.getRange(last,4).getValue()//ยอดคงเหลือ

if(row == 2){  
sh.getRange(2,4).setValue(deposit)  
carry = sh.getRange(‘E2’).setValue(deposit)  
}else{  
var balance = (deposit+amount)-withdraw  
sh.getRange(row,4).setValue(balance)//ยอดเงินคงเหลือ  
carry = sh.getRange(‘E2’).setValue(balance)//ยอดยกไป  
}  
}

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [August 25, 2024, 12:51am UTC](https://community.glideapps.com/t/how-to-make-column-2-column-3-column-4/75839/10 "2024-08-25T00:51:06Z")

</div>

> [@TTC56010](#):
>
> i don’t get it man that a lot of column i have only 4 can you  
> teach me or just show easier way

Darren’s method would get you what you need, if English is not native to you, you can discuss what you get stuck with in your own language, we’ll try and help you get through that.

These methods can be intimidating for newcomers, but Darren explained it very well in my honest opinion, so please give it a try first.
