I like to calculate the voltage first, that makes it possible to check it with a voltmeter.
After that, adjust the range and offset for the psi.
It is possible to make calculations and put that in code. I think, that the compiler should do the calculations, and the code should make visible what is going on.
I’m using floating point for the calculation.
// raw = is the raw ADC value
int raw = analogRead(A0);
// voltage is the voltage at the pin
// assuming the reference is default (5V).
float voltage = (float) raw / 1023.0 * 5.0;
// psi is the pressure 0...100 for 0.5...4.5V
// substract the offset, and adjust the range.
// The range is the resulting range divided by the original range.
float psi = (voltage - 0.5) * (100.0) / (4.5 - 0.5);
When you want to do something really ugly, you can also do this: int pressure = (analogRead(A0) - 102) * 5 / 41;