Formulas in Custom Fields?
Asked by Kelly Gabel:

Is there a way to use a formula in a custom field?


Answers:
author: Hannah Humbert - Simpla Workflows
body: [@Kelly Gabel](/t5/user/viewprofilepage/user-id/4037574) can you expand a bit around what you want to achieve? It is possible to perform basic arithmetic operations with numerical custom fields, but it's pretty limited.

comments: author: Kelly Gabel
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993)

Absolutely! I have a Budget Tracker and a Custom Field for Revenue and one for Expenses. I'd love to have a Profit field that automatically calculates the Profit between the two, so = Revenue - Expenses


author: Hannah Humbert - Simpla Workflows
body: [@Kelly Gabel](/t5/user/viewprofilepage/user-id/4037574) you should be able to use butler to calculate that. Have a look at this article [here](https://support.atlassian.com/trello/docs/working-with-custom-fields/) down the bottom under Custom Field Arithmetic. Let me know if you need any help setting it up ?


author: Kelly Gabel
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) Ok took me a few tweaks to get it right, but that totally worked! The only follow up question I have, so I used a trigger of when Revenue and Expenses are complete, then... but I'd love it to update in real time. I just didn't see an option for keeping it synced, like when those fields are updated vs. complete.  

Is that not available, or did I just miss it?


author: Hannah Humbert - Simpla Workflows
body: Try this:  

```
when custom field "regex:/.*(Expenses|Revenue).*/" is set, set custom field "Profit" to "{{%Revenue}} - {{%Expenses}}"
```

Regex is used here to create an OR statement; so you're saying: when either the expenses or revenue fields are set, then update the profit field. "Set" is when the field is either completed or updated, meaning that the profit field will dynamically update.


author: Kelly Gabel
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) Ok that totally worked and is super cool! Thank you! I feel like you have just opened up a whole new world of automation to me LOL


author: Hannah Humbert - Simpla Workflows
body: [@Kelly Gabel](/t5/user/viewprofilepage/user-id/4037574) yay glad that's working the way you want! ? it's pretty cool how much you can do with butler for pretty much free!


author: Kelly Gabel
body: [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993) Exactly!! Although, this does require a subscription to use the Custom Fields...but it's so affordable!

Now, I'm trying to do a roll up of those Profit values per list...so I'm experimenting!


author: Hannah Humbert - Simpla Workflows
body: That's true, there is some cost involved if you want to use custom fields. Have fun experimenting! ?


author: Dreamsuite Mike
body: Great response [@Hannah Humbert - Simpla Workflows](/t5/user/viewprofilepage/user-id/2109993)

[@Kelly Gabel](/t5/user/viewprofilepage/user-id/4037574) To roll up the values per list, you can use a [Trello Dashcard](https://trello.com/power-ups/6048e897c73d032a983e2a7c/dashcards) that you set at the top of the list:

<https://www.atlassian.com/blog/trello/dashcards-powerup>

With these, you can do sums and averages, they are really cool...

To keep the dashcard pinned to the top of the list:

1. Create a colourless label with the name ?
2. Create the following automation:

```
when a card is added to list "{listname}", sort the list by "?" label ascending
```


author: Kelly Gabel
body: [@Dreamsuite Mike](/t5/user/viewprofilepage/user-id/5153180) Woah. I've been using Dashcards for a while, but I had never even noticed the Metrics tab!!! This is GAME-CHANGING!! Thank you!


Tags: custom-fields