How do i create a button i google sheets that makes autosum?

Hey

I need to create a button, when clicked it should do autosum of predefined cells.

How do i do that? what script?

0 3 112
3 REPLIES 3

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Alinea_Avi

You donโ€™t need to create a button for this.
This is a calculation, so it can be made with Virtual column.
Basically, just a column you add to your table but which is not written on your sheets, that will make all calculation needed.

Typically, if you have a parent/child relation with two table (ex:Order, and line items with cost associated)
than your column [orderSum] will be:
SUM([Related LineItems][Cost])

More here:


i need the yellow cell to act like autosum, when a user is clicking on a button, as a reaction to a user action.

Hi @Alinea_Avi

That is not the way AppSheet works.
If you need to do so, I suggest you make a formula in another sheets through an IMPORTRANGE() or QUERY() or whatever fits your need, function, then a SUM().

I suggest:
={"Total col4";SUM(QUERY("sheetAndRangeWhereYourDataAre", col4))}

Top Labels in this Space