From: Michael Sc Date: 2007-02-07T21:03:17+09:00 Subject: Re: Beginner questions: sorting csv files on the daily return, I wanted to define two if statements so that two columns had to equal in order to do take the percantage change function. Does anyone have any ideas on this? I tried to do this. Thanks again for the help. 0.upto( a.size - 2 ) {|i| (a[i][1]==a[i+1][1] and a[i][2]==a[i+1][2]) (a[i+1][3] - a[i][3]) / a[i][3] * 100} -- Posted via http://www.ruby-forum.com/.