I figured out a solution. I cannot seem to paste the formula without getting a Forbidden Error. Thus my solution is in the attached spreadsheet.
If you see any errors, or know a better way of doing this I would love to learn more.
Attachments:
You must be
logged in to view attached files.