If I came off snooty it was not my intent. A lot of people get this wrong and it was my intent to provide accurate information.
The formula (assuming inches) is pixels in X / desired dpi = inches in print then do the same for Y pixels in Y / desired DPI = inches in print.
If you are good you can take an image thats just a little too small and do incremental resampling to increase it’s size reducing the pixelation factor. This is one of the things you have to experiment with and see if the results are acceptable or not. Some times it comes out ok some times there is just no way to increase the size and have it look decent.
If I can get away with it and I’m doing all original art I use 600dpi but if Im using online art or something I can go as low as 300dpi.