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 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/