Hi,
Since beginning of December (a week ago), there’s a free plugin on the WordPress plugin repository that aims to solve this exact problem. It’s called Calculated Fields for ACF. From your description above, I think this plugin can solve your problem without having to write code.
https://wordpress.org/plugins/calculated-fields-for-acf/advanced/