Search code examples
excelexcel-formulaformattingformulafractions

Excel how to keep fraction as fraction 5/5 not 1 or 0/5 not 0


I have a sheet that counts the positive cells in a range, and all the non blank cells in the same range. It displays the result as a fraction. I would like to stop excel from displaying fractions as whole numbers, e.g., 5/5 not 1, 0/2 not 0, 0/5 not 0. Below is an example of what I'm trying to accomplish.

The formula in column F is as follows: =COUNTIF(A2:E2,">0")/COUNTIF(A2:E2,"<>")

Column G shows how I would like the results displayed.

enter image description here


Solution

  • Enclose the / in quotes and concatenate with &.

    =COUNTIF(A2:E2,">0")&"/"&COUNTIF(A2:E2,"<>")