I've created a repeating with a number of calculated values inside. There's one with a lookup function that works fine, others maths calculations that work fine, and then one with an If function that checks whether a tick box is set to true, if it is it takes its value from field A, if its not it takes its value from field B!
This last one does not work.
If I remove it from the repeating section it does work, but then the control doesn't function properly as it's not scoped to the row that it belongs to, so if I add a second row and select my tick box it will take override the first row and my calculations will be wrong.
calculations are correct in this image with 1 row
Now with a second row my calculations go all crazy.
If I move the calculated value inside the repeating section it simply fails to update when the tick box "Override Markup" is selected and the markup will stay the same. The calculations are correct, but the user no longer has the ability to set their own markups.
My formula is
The replace function is in there because the values were being returned in  suggesting that it was expecting an array, but it shouldn't have been. However, without the replace functions the issue still remains.
Any help really appreciated here.