Thanks all of you for replying. I'm going to have to study your responses a bit before I can respond. I wrote this code the way I did because I was getting errors that I stopped getting with these fixes and I got the correct results from this code, up until the last line. All of you introduced concepts that I haven't seen or thought of before and I'll need to look at them carefully.
Peter's right about pandas and we talked about this the first time we visited this problem. pandas is a steep learning curve, and it makes more sense to stick with straight Python this first time. This spreadsheet problem is fairly typical of several I need to do, and I will be using pandas for future problems. But this time I'll stick with learning and understanding what I've got. Thanks again all, and I'll write back when I have a handle on what you've said, and probably I'll have more questions to ask. -- https://mail.python.org/mailman/listinfo/python-list