We develop an analytical approach for studying the FMR frequency shift due to dipolar interactions and surface effects in two-dimensional arrays of nanomagnets with (effective) uniaxial anisotropy along the magnetic field. For this we build a general formalism on the basis of perturbation theory that applies to dilute assemblies but which goes beyond the point-dipole approximation as it takes account of the size and shape of the nano-elements, in addition to their separation and spatial arrangement. The contribution to the frequency shift due to the shape and size of the nano-elements has been obtained in terms of their aspect ratio, their separation and the lattice geometry. We have also varied the size of the array itself and compared the results with a semi-analytical model and reached an agreement that improves as the size of the array increases. We find that the red-shift of the ferromagnetic resonance due to dipolar interactions decreases for smaller arrays. Surface effects may induce either a blue-shift or a red-shift of the FMR frequency, depending on the crystal and magnetic properties of the nano-elements themselves. In particular, some configurations of the nano-elements assemblies may lead to a full compensation between surface effects and dipole interactions.