Google-sheets – IF statement not working in Google Sheets

formattingformulasgoogle sheetsworksheet-function

So I'm using Google Sheets and I'm trying to determine whether or not cells in a certain column AO have a higher value then cells in another column O. My formula is =IF(AO6 > O6,"UNDER","OVER"). The value in AO6 is 217 and the value in O6 is 225. However, the cell keeps saying UNDER when it should be saying OVER. 217 is not greater than 225??? Am I missing something???

Best Answer

This is caused by formatting... Most likely cell AO is formatted (or evaluated) as Plain text and text value is always zero. You can fix it by using VALUE() or by changing formatting for those involved cells

=IF(VALUE(AO6) > VALUE(O6), "UNDER", "OVER")