In my case, we have three variables - the underlying price, the strike price, and the datadate. When the program picks up the strike price that is nearest to the underlying price, I also need it to consider the datadate. Please see the attached document for a sample.
So basically, I need it to pick the nearest strike price within that given date.
For example, on 2011/1/16, the underlying price is 26.33. The closest strike price is 26.5.
On 2011/1/17, the underlying price is 26.11 and the closest strike price is 26.