Example: =IF(A1>A2,Value in cell A1 is greater than A2, IF(A2>A1,Value in cell A2 is greater than A1,Value in cell A2 and A1 are equal)) Referring to the Excel table above we are comparing values in cell A1 and A2. Here we are checking two conditions with nested If Else function:. 1  If value in cell A1 is greater than value in cell A2.  If value in cell A2 is greater than value in cell A1.