If you ask me then I would like to assure you that if the problem can be solve with the macro event than there is no need to hide anything. The calculation is very easy. Below is the code of a target cell F5. You can take reference from it.
The only issue with it is that if you change the value of D5 then F5 does not change or refresh. To change it you have to double click on F5 after each value change.