Share via

Microsoft Excel - IF Function

Anonymous
2022-08-17T11:30:45+00:00

Hi,

I want a cell to state Yes or No if a value in one cell, is more or less than value of another cell. Screenshot is best example to go off - as it states to show whether cell G10 is more than D11, it says Yes - =IF(G11>D11, "Yes").

The problem is, it states all cells as Yes even when the equation isn't true, as Cell D16 is 486, 14 values below Cell G16 which is 500 yet it still states Yes.

Can anyone advise?

Shaun

Microsoft 365 and Office | Excel | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2022-08-17T13:22:49+00:00

    You formula only specifies the "value-if-true" part. If the condition is false, Excel will then return FALSE.

    Change the formula to either

    =IF(G16>D16,"Yes","No")

    or

    =IF(G16>D16,"Yes","")

    depending on your preference.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-08-17T12:00:03+00:00

    Hi HansV,

    That's what I was insinuating sorry. So as it stands, the formula in H15 =IF(D15>G15,"Yes"). But the value shows as FALSE. See image again, how do I reset calculation as automatic sorry?

    It appears irregardless of cell values, all cells show as Yes or False. So maybe it is an automatic error that needs aligning.

    Was this answer helpful?

    0 comments No comments
  3. HansV 462.6K Reputation points
    2022-08-17T11:48:36+00:00

    G16 = 500 is larger than D16 = 486 so =IF(G16>D16,"Yes") should indeed return "Yes".

    The result in many other rows, such as rows 10, 11, 12 looks wrong.

    Are you sure that Calculation has been set to Automatic?

    Was this answer helpful?

    0 comments No comments