From: Thomas Wieczorek Date: 2008-08-20T21:22:04+09:00 Subject: Re: array of hashes - need to iterate and calulate stats but how You can also create Structs in Ruby if you prefer them Item = Struct.new(:title, :article_number) it = Item.new("Wii", "Wii") it.title #=>"Wii" You can add as many members as you like in the Struct constructor. As to go with your statistics, I agree with the others. I'd use a statitiscs Hash and count the different items: stats_hash = { } Stats = Struct.new(:count, :sold) item_array.each { |it| unless hash[item[:article_number]] hash[item[:article_number]] = Stats.new(0, 0) end hash[item[:article_number]].count += 1 hash[item[:article_number]].sold += 1 if item[:did_it_sell] }