Explanation
In this example, the goal is to calculate the percentage sold for each item listed in the table, where original number (Total) is in column C and the Sold number is in column D. In other words, if we know we started with 144 apples, and sold 108 apples, we want to calculate that 75% of the apples were sold. The general formula for this calculation, where “x” is the percentage sold, is:
x=total/sold
x=144/108
x=0.75
Converting this to an Excel formula with cell references, the formula in E5 becomes:
=C5/D5
=144/108
=0.75
When the result the Percentage number format is applied, 0.75 is displayed as 75%. As the formula is copied down, the formula returns percentage sold for item in the table.
Formatting percentages in Excel
In mathematics, a percentage is a number expressed as a fraction of 100. For example, 45% is read as “Forty-five percent” and is equivalent to 45/100 or 0.45. Accordingly, the results in column E are decimal values , with the Percentage number format applied.
Explanation
In this example if a task is marked “Done”, then it is considered complete. The goal is to calculate the percent complete for the project by showing the ratio of complete tasks to total tasks, expressed as a percentage. The formula in F6 is:
=COUNTA(C5:C11)/COUNTA(B5:B11)
At the core, this formula simply divides tasks complete by the total task count:
=complete/total
which is then formatted as a percentage . To count completed tasks, we count non-blank cells in the range C5:C11 with the COUNTA function :
=COUNTA(C5:C11) // returns 4
Unlike the COUNT function , which counts only numeric values , COUNTA will count cells that include numbers or text.
To count total tasks, we count non-blank cells in the range C5:C11, again with COUNTA:
COUNTA(B5:B11) // returns 7
After COUNTA runs, we can simply the formula to:
=4/7 // 0.571428571428571
Four divided by 7 results in the decimal number 0.571428571428571 which is displayed as 57% once the Percentage number format is applied.