Answer
Yes, departures are taken into account when assessing ordinary and continuous residence. A short trip by itself does not necessarily reset the period, but a prolonged absence can interrupt it. A continuous absence of six months or more is especially important, as it may cause the period to be counted anew.
You should not merely total the number of days in each calendar year: for ciudadanía legal, the real connection to the country and the nature of the absences are important. Frequent long trips may raise questions even when each one is shorter than the maximum allowable period.
Before applying, request your immigration travel history and compare it with evidence of housing, work, and other ties. If there has been a prolonged absence, obtain an individual assessment of the date from which the Corte Electoral will count the required period.