Linearization of IR sensor GP2Y0A21YK
You will note that there are two possible distances for voltages above 400mV to 3.15V or so. 

So you will have to decide which curve you want to use (it's not possible to tell which it is from the voltage alone). 

Then fit a function to the given points. You can pull the data directly from the pdf with WebPlotDigitizer or a similar method, and use MATLAB to fit a polynomial or do it manually or with Scilab etc. using least squares error for example. Even Excel can be used. Or just use the points they've given you and use linear interpolation or cubic splines if you want to get fancy.