Either from anë + tej (cf. këndej, përtej) or from Proto-Indo-European *h₂entíos (“end”). Compare Armenian and (“there”), Gothic and (“up there, about there”), anda- (“against, opposite”).
andej