As far as a straight line shot...You can pull up a ballistic chart and get a fair estimation of distance for a 'pass through' or miss...(Distance, Energy, Velocity,Trajectory)
When it comes to a ricochet, that's a totally different matter... there are a lot of factors that will come into play...
The density of the object hit,
the angle at which it's hit,
the bullet's speed at the time it's hit,
the type of bullet,
and the angle which it departs whatever is hit...
Our old police range used to be in an old abandoned quarry and it was not uncommon for low powered wadcutter bullets to bounce straight back 75 yards... These had a muzzle velocity of about 750fps and were if fairly soft lead.. Fortunately, no one ever got hit in the eye, but by the time the slug had come back that far, most of the energy was gone...
I've also seen normal handgun, FMJs, normally used in most street shootings strike a vehicle or other object and take off to a point a city block or more and hit someone, causing enough injury that they were taken to the hospital.
We had one, where a greenhouse owner/operator in the edge of the city was killed after being struck in the head by a 30-06 round that was originally fired from almost 1/2 mile (973 yds, straight line) away after a property owner/hunter missed a deer, shooting in a different direction than the greenhouse by about 45 degrees...It was investigated and ruled to be strictly an accident, and no criminal charges were filed.... But I'm sure there was a sizable civil suit entered by the victim's family...