OK,

you use 2,5V as VRef+, this is near the limit ! (see page 243 of the PIC16F917-manual).

You talk about an offset-error and use the formula *772/1000 to compensate it ... this seems to be a linearity-error, not an offset.

What voltages do you attach and what do you measure ?