How to calculate the sum for the sum of two condition are equal?

I am doing kobo survey in which the total have to be same for two condition like total= male + female and total = agebelow 20 + age between 20 and 40 +ageabove 40… I am planning to calculate total if the both condition are equal and display error is they are not equal.

Welcome to the community, @abinprajapati! Would you also mind sharing a dummy question that can be used to address this issue? The community could then help you solve it.