@Peter87 In the main program, there is if else statement. TpricePT3tax came from if, TpriceSPMtax came from else if. Let's say the first output I chose TpricePT3tax, it will update TpricePT3tax as the maximum and min=0. When I did the second loop and chose TpriceSPMtax, the total is higher and TpricePT3tax become lower so now the maximum is updated as Max= TpriceSPMtax, but the minimum should be updated as TpricePT3tax but it is now Min=0. noted: I've removed the last 4 if statement and we couldn't use the suggested coding from you as we didn't learned it in class.