Formula only add visible currency

Formula only add visible currency

Hello all,

I have been creating a form that i would like to use ( and later on also send to my customer ) where i put some simple products and general worik that i do for a customer.

I was really digging the form builder, untill i found out, that even if i have currency fields not visible, or by rule only visible when certain selctions are made, thewy are still added to my total currecny formula.

Here is an example:

I offer my customers antivirus product, which is possible in 4 different brands, with all 4, having 3 options.

So right now i have it setup this way:

Dropwdown box to select 1 out of 4 brands of Antivirus
I have rules setup that depending o the choice, a new field shows itself that shows that specific chosen brand, with 3 options.

Then depending on what of the 3 options i select, a currency field will show up, with the currency already inside.

This all works flawless, but here is the problem.

At the end i have a formula, to add up all prices from the stuff i offer. But the formula adds up all the fields regardless if they are visible or not, so i always end up with all options added up. 

I would like to know how i would fix this, so that the formula only adds up all the visible fields in my form. I really don't want to add in the prices manually every time, because this defeats the purpose of having these kind of forms in my opinion.

Kind regards,
Andreas