Spritesheets: Finding the amount of rows and columns via the frame count and image size

Hello developers,

I am currently in the process of creating a module that will essentially make videos via spritesheets, but I am having trouble finding the amount of rows and columns. I want to calculate this using the frame count, but I am not sure of the correct mathematical operation on how to do this. I do know how to find the area of an individual sprite though, if that helps: (spriteSheetDimensions.X / sprite.columns) * (spriteSheetDimensions.Y / sprite.rows)