If you are reading this, then you most likely know what is a stem and what "flipping a stem" means and why it is done. For those who came to this page by accident, here are few clarifications:
 A stem is a part of a bicycle that connects the steering tube (which is the top part of the front fork) with the handlebar. There are two types of stem. The "quill stem" is found on older bicycles and in cheaper today's bikes. Most of today's quality bicycles have the stem as the one in the picture in this post. It connects to the steering tube with two bolts. Usually this kind of stem is not perpendicular to the axis of the steering tube, but is at a certain angle to it  angle α in the picture. When this is the case, you can raise (or lower) the handlebar by flipping the stem around.
If you flip the stem from the picture around, the point T1 (intersection of the central axis of the stem with the handlebar) will move to point T2.
The question is, how much will you raise the handlebar by flipping the stem. Will it be too high, too low, or is it just not worth the trouble flipping the stem at all?
Well, I've got the answer for you. I will not go into detail of developing all the equations, I'll just state the final result:
If the steering tube is at the angle β, the stem has a flipflop angle α and length L, then, after flipping the stem, the handlebar will move vertically by ΔY and horizontally by ΔX, calculated by:
ΔY=L[cos(βα)cos(β+α)], ΔX=L[sin(βα)sin(β+α)]
Positive values mean that the handlebar will move up and forward, negative values move the handlebar down and backward.
In the following table are the values of ΔY and ΔX in mm, for some common values of β and α and for the stem length L=100 mm. If you have a stem of different length, multiply the values in the table by L/100, where L is the length of the stem in mm.
α = 6 º

α = 8 º

α = 10 º

α = 17 º
 
ΔY

ΔX

ΔY

ΔX

ΔY

ΔX

ΔY

ΔX
 
β = 72 º

19,9

6,5

26,5

8,6

33,0

10,7

55,6

18,1

β = 73 º

20,0

6,1

26,6

8,1

33,2

10,2

55,9

17,1

β = 74 º

20,1

5,8

26,8

7,7

33,4

9,6

56,2

16,1

β = 75 º

20,2

5,4

26,9

7,2

33,6

9,0

56,5

15,1
