Calculating column totals in Airtable similar to Excel's functionality?

Hey everyone, I’m working on an Airtable project and I’ve hit a snag. I really need to figure out how to get running totals for a column, kind of like what you can do in Excel.

Here’s what I’m trying to achieve:

Item    Running Total
5       5
10      15
3       18
7       25

I want each row to show the sum of all the values above it, including itself. Is there a way to do this in Airtable? Maybe with a formula or something? I’ve been scratching my head over this for a while now, so any help would be super appreciated. Thanks in advance!

While the previous answer offers a solid solution, there is another approach that might better suit larger datasets. You can use Airtable’s Rollup field with a linked table. First, create a new table (for example, ‘Running Totals’) and set up a link field in your original table to connect to it. Next, in the new table, establish a rollup field that sums the linked Item values. Finally, add a lookup field in your original table to display the rollup result. This strategy updates automatically with any changes and can enhance performance, despite requiring an extra table.

hey there, i’ve got another idea for ya. try using scripting blocks in airtable. you can write a custom script to calculate running totals and update the field automatically. it’s a bit more advanced, but it gives you more control and flexibility. plus, it’ll handle new rows better than formulas. just a thought!

I’ve been using Airtable for a while now, and I can tell you that achieving running totals isn’t as straightforward as in Excel. However, there’s a workaround that’s been pretty reliable for me.

What you’ll want to do is create a new column for your running total and use a formula field. The trick is to reference the previous row’s running total and add the current row’s value to it. Here’s the formula I use:

IF(ROW_NUMBER()=1, {Item}, {Item} + LOOKUP(PREV_ROW(), {Running Total}))

This formula checks if it’s the first row (ROW_NUMBER()=1). If so, it just uses the Item value. For all other rows, it adds the Item value to the previous row’s Running Total.

Keep in mind that this method can slow down your base if you’re dealing with a large number of records. Also, it won’t update automatically if you insert new rows in the middle of your data. You’d need to resort your table to recalculate. But for most use cases, it works pretty well.