The suppression of heavy charmonia states in heavy-ion collisions is a phenomenon understood as a consequence of QGP formation in the hot, dense system formed in heavy ion collisions at the LHC. In addition to hot matter effects in heavy-ion collisions , cold nuclear effects may also affect heavy charmonia production . Therefore, a full assessment requires detailed studies on the effects present in both A-A and p+A collisions. Based on p+Pb data collected in 2013 and pp and Pb+Pb data collected in 2015 at the LHC, the ATLAS experiment has studied prompt and non-prompt J/psi and psi(2S)productions via the di-muon decay final states. The production and excited-to-ground state ratios of heavy charmonia measured in both p+Pb and Pb+Pb collision data with respect to that measured in pp collision data will be presented in intervals of transverse momentum, rapidity and centrality.