Crystal has a median formula built in, you shouldn't have to do anything other than use it. Assuming you're using XI, do a search on "Median" in the help. When you double-click on the result ("Median function") it will give you two options. Select the bottom one which applies to Basic and Crystal syntax. The top one is for working with OLAP cubes which use a different syntax.
-Dell