@Daniel12345,
If I had to do this job, I would export the spreadsheet in Excel-tab format, read it with a programming language that has dictionaries, add a key corresponding to this pair, and keep updating the value corresponding to each key as the count for this pair increases. Programming languages that would do well for this kind of task include Python, Perl, Ruby, and Visual Basic. (With Visual Basic, you probably wouldn't even have to do the Excel-tab export.) Take your pick, and good luck!