Given comparable condition, the rule in most cases is the earlier the better. Lower serial number are more desirable than higher, pre-model marked more desirable than model 17, model 17 more desirable than 17-3, diamond grips more desirable than non, etc. Boxes and other accessories add to the value. Aftermarket grips may add or detract.
In an online auction, at least one other person believes that the gun is worth one bid less than the winning bidder is willing to pay. So, if you see what you like, you can't go very far wrong.
Bob