Is there a way to set the formula for calculation to be the contents of a field?

In case that is not clear, my problem is that I want to use the same calculation numerous times. So currently I have a bunch of portals with a calculation in them. Each time I change the calculation, I need to recopy it to all the portals. What I want to do is have a global field containing the formula and then have the calculation equal to the formula in the global field.

Nevermind. I just realized, I could use a custom function to achieve this.