I don't know what your sheet looks like, what data you need to return, 
or what gem you're using to access the sheet.
In general a hash could contain all the relevant data without having to 
pick and choose, possibly in a nested hash.

Since I don't know what your data looks like I'll give you a generic 
example.

h = {}

sheet.each do |row|

  #Create a new nested hash with the key from the first column
  h[ row[0].value ] ||= {}

  #Reference it so we don't have to keep writing that line
  ref = h[ row[0].value ]

  #Fill in other details
  ref[ 'password' ] = row[1].value
  ref[ 'data1' ] = row[2].value
  ref[ 'data2' ] = row[3].value

end

-- 
Posted via http://www.ruby-forum.com/.