I guess this would fall under the same thread title although a different issue. In this file (same as file I originally attached to this thread but updated), what am I doing wrong on lines 546 in which I am not getting the sum of results of line 539. I just want to add the ones where the sales person is different than what's in the While statement it's enclosed in. (you saw it briefly yesterday as you helped me with it). see attached files. One is the php file and two are screenshots of what Im trying to add. Under Split Sales for in the screen shot I have a results of my test but its not right number.