Rather than just asking questions, please suggest a logic to process the data that can give rise to a solution. I'm only working with a small sample. As for spped, I've no idea. You can step through the code to see how it functions. A different logic may be more efficient, let me have your suggestions.