Okay I understand, that’s great. But this function can only be called from a template, right? That can’t be done from the ACF Custom Fields menu in the wp backend, can it? Thanks for your reply in advance.
You could probably create an ajax function to call this calculation in the backend using the many hooks available for ACF (check the documentation) but it’s not the easiest solution and if you’re not sufficiently good at php/ajax/wp hooks it will be quite the challenge.