i often find myself having to do stupid things like layering drums and other samples via midi over poorly-mixed, pre-sequenced 2 track instrumentals (

). this requires a high degree of accuracy in bpm identification (as opposed to remixes, which can be ballpark'd, chopped etc.)...i find the most consistently reliable method is the mathematical one described above. i'm no mathematician, but wanted to clarify my 'formula' for doing this in case others find themselves in the same boat.
as noted, zoom in and put your cursor on the downbeat, then select as many bars as you need (more bars = more accuracy)....make sure you're right on the downbeat on both ends as accurately as possible.
now let's say:
X = time of selection in seconds
Y = number of beats in selection (number of bars * 4 for 4/4)
60 divided by X = Z
Z * Y = BPM
nice and sleazy.