As others have pointed out, excommunication has nothing to do with not being a Catholic, or ceasing to be a Catholic. Excommunication is a canonical penalty imposed in certain circumstances for canonical offences, but an excommunicated Catholic is still a Catholic, just like an American citizen who is sentenced to a fine or a term of imprisonment is still an American citizen.
A Catholic, in Catholic teaching, is (a) a baptised Christian, who is (b) in eucharistic communion with a church gathered around a bishop who is in communion with the bishop of Rome.
“Communion” is a relationship and, as Facebook users know, relationship status is not a simple binary. Sometimes it’s complicated.
In the English-speaking world, due I suspect to the influence of Protestantism, there’s a tendency to identify “litmus tests” for the state of the relationship which focus on belief. Do you believe X? If not, you’re not a Catholic. However belief is just one aspect of the relationship; a failure to believe this or that may impair a relationship of communion, without necessarily destroying it. The relationship also embraces shared worship, shared identity, communal participation, shared sacramental life, etc. (For what it’s worth, traditionally the key beliefs are those set out in the Creed. Transubstantiation is not one of them.)
Traditionally the church is reluctant to conclude that the relationship has completely terminated; if this decision is made, it is nearly always by the individual deciding that he is no longer a Catholic. But, while saying that you are no longer a Catholic is a pretty strong indicator that you aren’t, ultimately the issue is a factual one; what kind of relationship, if any, do you have with the Catholic church? There was experience, a few years back, of some people in Germany declaring publicly that they had left the church (in order to avoid the [state-imposed] church tax) but still presenting themselves to the church for, e.g. weddings, funerals, etc, and even presenting their children for baptism.
Probably the clearest way that you can definitely cease to be a Catholic is by formally joining another church and participating in it. But if you are leaving Catholicism for simple unbelief, well, it may be hard to point to some objectively verifiable cast-iron clinching evidence that you are not a Catholic. Saying publicly that you have left the church, plus avoiding any kind of participation in the church, is pretty clear, though.