Calculation Issues

Calculate the Percentage of Cells Containing a Value in Excel

Kushani NimanthikaKushani Nimanthika Dec 2, 2026 868 views

Question details

Calculate the percentage of response cells that contain a specific value, such as a.

Calculate the Percentage of Cells Containing a Value in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A row contains product or customer responses, and the user wants to find the share marked with a particular value.
Observed behavior
The desired result is a percentage of matching responses, using either a fixed number of cells or the number of completed responses.
Before you start

Identify the response range and the value you want to count. Decide whether the denominator should include all expected response cells or only nonempty cells.

Solution 1Recommended

Calculate the Percentage of Completed Responses

Use this formula when the number of completed responses can vary.

1
Enter the formula

Select an empty cell and enter =IF(COUNTA(B2:K2)=0,"",COUNTIF(B2:K2,"a")/COUNTA(B2:K2)). Replace B2:K2 and a with your response range and target value.

2
Format as a percentage

With the result cell selected, go to Home and select Percent Style (%).

3
Apply to other rows

Drag the result cell's fill handle down to calculate the percentage for additional rows.

Calculate the Percentage of Completed Responses
How the denominator works: COUNTA counts nonempty cells, including cells containing formulas that return an empty string. The formula displays a blank when COUNTA finds no values.
Calculate response percentages

Calculate Response Percentages in WPS Spreadsheets

Use COUNTIF and COUNTA in WPS Spreadsheets to calculate the share of completed responses matching a value, then format the result as a percentage.

  1. 1. Open your spreadsheet: Open WPS Spreadsheets and select Open to load your Excel workbook.
  2. 2. Enter the formula: Select an empty cell and enter =IF(COUNTA(B2:K2)=0,"",COUNTIF(B2:K2,"a")/COUNTA(B2:K2)). Adjust the range and target value as needed.
  3. 3. Format the result: Select the formula cell, then choose Percent Style (%) on the Home tab.
  4. 4. Fill down: Drag the cell's fill handle down to calculate percentages for other response rows.
Count matching responses with COUNTIFCalculate percentages from completed response cellsOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

How do I count a different response, such as r?

Replace "a" with "r" in the COUNTIF formula, for example, =COUNTIF(B2:K2,"r")/COUNTA(B2:K2).

Why does my formula show a division error?

If COUNTA returns zero, dividing by it produces a #DIV/0! error. Use =IF(COUNTA(B2:K2)=0,"",COUNTIF(B2:K2,"a")/COUNTA(B2:K2)) to display a blank when the range is empty.

Does COUNTIF distinguish between uppercase and lowercase letters?

No. COUNTIF is not case-sensitive, so the criterion "a" counts both a and A.

How do I include blank cells in the percentage?

Divide by the fixed number of expected response cells instead of COUNTA. For four cells in B2:E2, use =COUNTIF(B2:E2,"a")/4.