Summ 2 fields of data collection and the result must be stored in a third field.

Hello everybody, i must say that i am a beginner in coding but i am bulding this simple page.
I created a dynamic page that where the logged in user can put into text input his personal fitness record connected to data collection… i found a tutorial and this part is working.
What i am not able to do is to create an hook that allow me make calculation with the data and save the result in a field of the collection.
I tryed to do it by following the tutorial age from dob but no chance…
Anybody can help me with real examples?