Forum Discussion

Loganc's avatar
Loganc
Occasional Reader
Feb 01, 2026

Formula result not showing in cell

Attached is my code and the formula result showing 50%. But in the cell where the formula is located, it displays a 0%. I have tried formatting the cell to be a number, percentage, and everything else, yet it still does not put the formula result in properly. Am I missing something?

3 Replies

  • Olufemi7's avatar
    Olufemi7
    Iron Contributor

    HelloLoganc​

    Yes, the formula is correct according to Microsoft documentation.

    Official Microsoft documentation for the IF function:
    https://support.microsoft.com/en-us/office/if-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2

    The IF function syntax is:
    =IF(logical_test, value_if_true, value_if_false)

    Your formula correctly:
    Uses COUNTIF and COUNTIFS, which return numeric values
    Divides the counts to return a decimal value (0.5)
    Relies on cell formatting to display the decimal as a percentage (50%)

    The reason you see 50% in the Formula Arguments dialog but 0% in the worksheet cell is not because the formula is wrong. It is due to Excel’s handling of empty strings ("") in numeric or percentage-formatted cells. When IF returns an empty string in one branch, Excel can temporarily coerce that result to zero or fail to refresh the displayed value until recalculation.

    This behavior is consistent with Excel’s documented behavior and is a known display/calculation quirk, not a formula error.

    A commonly recommended workaround for numeric formulas is to return NA() instead of an empty string, for example:

    =IF(COUNTIF($B:$B,"Alpha")=0, NA(), COUNTIFS($B:$B,"Alpha",$F:$F,"Pass") / COUNTIF($B:$B,"Alpha"))

    This avoids empty-string coercion and ensures the cell displays the correct percentage consistently.

    In summary, the formula logic is valid and compliant with Microsoft documentation; the issue is related to Excel’s calculation/display behavior rather than the formula itself.

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Please check if you are not in Manual calculation mode

    Insert Function box ignores it, but result in the cell could be not recalculated.

  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor

    Did you set decimal places correctly after formatting the cell as percentage? Can you please share few sample data and show your desired result?

Resources