That's a rather vague description...
Please note that we can't look over your shoulder so we can't see what you're struggling with nor what the tables/data look like.
Therefore, you'd need to help us help you. One of the easiest ways to do so is described in the first artilce referenced in my signature. Please take the time to read and follow the advice given in that link. I'm confident you'll get a tested answer almost immediately.
Lutz
A pessimist is an optimist with experience. How to get fast answers to your question[/url]
How to post performance related questions[/url]
Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]