Irregular cycles?

My periods always last about the same number of days (usually 7) but some months I won't have my period, and when I do they are during different times of the month. Is there a reason behind this? I don't have sex, but I don't eat very healthily. I would love to know if I need to do something differently. Thank you to everyone in advance who contributes!