Writing Complex Formulas

I wrote a formula that goes through several 10s of thousands of rows to add up instances of a date showing up and it has been making my Grist website crash. Is there a more efficient way of doing this? I used a for loop to do this.

Thank You!

Sometimes loops are necessary. It’s hard to give general tips, we’d need to know what you want to achieve and what code you tried.

I can tell you that a formula of this nature looks like it should be OK but is actually disastrous:

records = Table.lookupRecords(...)
for ...
    ... records.something ...