It's easy for me to look at an IRA, no deposits or withdrawal in a year, and compare the return to some index. Once you start adding transactions, not so easy. Here's a method that answers your goal as closely as I can offer:
SPY goes back to 1993. It's the most quoted ETF that replicates the S&P 500, and you specifically asked to compare how the investment would have gone if you were in such a fund. This is an important distinction, as I don't have to adjust for its .09% expense, as you would have been subject to it in this fund.
Simply go to Yahoo, and start with the historical prices. Easy to do this on a spreadsheet. I'll assume you can find all your purchases inc dates & dollars invested. Look these up and treat those dollars as purchases of SPY. Once the list is done, go back and look up the dividends, issues quarterly, and on the dividend date, add the shares it would purchase based on that day's price. Of course, any withdrawals get accounted for the same way, take out the number of SPY shares it would have bought. Remember to include the commission on SPY, whatever your broker charges.
If I've missed something, I'm sure we'll see someone point that out, I'd be happy to edit that in, to make this wiki-worthy.
Edit - due to the nature of comments and the inability to edit, I'm adding this here. Perhaps I'm reading the question too pedantically, perhaps not. I'm reading it as "if instead of doing whatever I did, I invested in an S&P index fund, how would I have performed?" To measure one's return against a benchmark, the mechanics of the benchmarks calculation are not needed. In a comment I offer an example - if there were an ETF based on some type of black-box investing for which the investments were not disclosed at all, only day's end pricing, my answer above still applies exactly. The validity of such comparisons is a different question, but the fact that the formulation of the ETF doesn't come into play remains. In my comment below which I removed I hypothesized an ETF name, not intending it to come off as sarcastic. For the record, if one wishes to start JoesETF, I'm ok with it.