Complex sentence: Depending on the office and the state, it may be possible for a voter to cast a write-in vote for a candidate whose name does not appear on the ballot; but, it is extremely rare for such a candidate to win office.
Split into simpler sentences: Depending on the office and the state, it may be possible for a voter to cast a write-in vote for a candidate whose name does not appear on the ballot. It is extremely rare for such a candidate to win office.