(1) No election for an office may be set aside on account of illegal votes, unless it appears that an amount of illegal votes has been given to the person whose right is being contested, that, if taken from that person, would reduce the number of the person's legal votes below the number of votes given to some other person for the same office, after deducting therefrom the illegal votes that may be shown to have been given to the other person.
(2) No election for a measure may be set aside on account of illegal votes, unless it appears that an amount of illegal votes has been given to the winning choice being contested, that, if taken from that winning choice, would reduce the number of legal votes for the winning choice below the number of votes given to the other choice, after deducting therefrom the illegal votes that may be shown to have been given to the other choice.