Get temperature via ADC of microcontroller
I think your formula is ok. As mentioned by Sanjeev, do not forget to get the approximate number of samples you need to get the accuracy you need.

Here is an example of an ADC_get_value routine that I used time ago. It uses a similar formula:

/* Function name    :   unsigned char ConvertAdcvalueToFuelLevel( unsigned int x )
* Crated by     :   
* Description   :   This function converts from ADC values to its equivalent voltage and then returns a number
*                   between 0 - 255 representing voltages between 0 - 5000mV.
*                   The receiver must multiply the returned value by 19.6078 in order to get the equivalent
*                   voltage.
*                   The transfer function for the hardware used on the ADC input is:
*                   f(x)= 0.999*x       x:volts
******************************************************************************************************************/
unsigned char ConvertAdcvalueToFuelLevel( unsigned int x )
{
    unsigned int Voltage;
    unsigned int Offset = 5;        //15mV

    //Converts from ADC bits to voltage
    Voltage = ((unsigned long int)((unsigned long int)x * 4990))/4095;  //(x*Vref)/4095 (Millivolts)

    //The hardware used on the analog input is almost lineal between 0V and 4.2V.
    Voltage = (unsigned int)(0.999*Voltage) + Offset;
    return (unsigned char)(Voltage / 19.6078);
}