Among the statistics baseball managers and coaches use to track the performance of their players is on-base percentage. Roughly, this is how often a player gets on base compared to how often he's up to bat, or times on base divided by times at bat. The formula is a little more complicated than that, however, and infrequently can lead to some peculiar results.
To calculate a player's on-base percentage, first add the number of his hits, the number of times he's walked and the number of times he's been hit by a pitch. Divide that by the total number of his times at bat, plus his walks, the times he's been hit by a pitch and the number of sacrifice flies he's hit, or (Hits + walks + hit by pitch) / (at bats + walks + hit by pitch + sacrifice flies). For example, if a player has been up to bat 375 times and has gotten 112 hits, 40 walks, been hit by the pitch 4 times and hit 5 sacrifice flies, his OBP will be (112 + 40 + 4) divided by (375 + 40 + 4 + 5) = 156 divided by 424 = .368.
OBP doesn't always accurately reflect how often a play actually gets on base, though. For example, a player who's at bat three times and reaches first base by hitting into a fielder's choice, getting on base thanks to an error, and via catcher's interference, still will have an OBP of .000. Also, in certain circumstances a player's on-base percentage can be lower than his batting average, because sacrifices aren't counted as an at-bat but are used in calculating OPB. For example, suppose a player is at bat 10 times, gets three hits and hits one sacrifice fly. The sacrifice won't count towards his batting average, so he'll be 3 for 9, for an average of .333. His OBP, however, will be 3 divided by (9 + 1) = .300.