Exciton decomposition of compounds with ionic bonds