How to Calculate the Percentage of Specific Values Excluding N/A in Excel
Question details
The user needs an Excel formula to calculate the percentage of specific text entries (e.g., 'W') out of a total, while explicitly excluding certain unspecified values (e.g., 'NA').

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating the percentage occurrences of a specific string while ignoring certain other text values to maintain an accurate denominator.
- Observed behavior
- Requires a formula combining COUNTIF and COUNTA to accurately count target values, subtract excluded values from the total count, and display the result correctly as a formatted percentage.
Ensure your data range does not contain hidden blank spaces or typos, as extra spaces can cause the COUNTIF and COUNTA formulas to incorrectly evaluate your text entries.
Use COUNTIF and COUNTA with Percentage Formatting
This method calculates the correct ratio by counting target values and dividing by the total number of entries minus the excluded values, then formats the cell to correctly display as a percentage.
By dividing the count of your target value by the total non-blank cells minus the excluded values, you get a clean decimal ratio.
Applying Excel's native Percentage format automatically multiplies the decimal by 100 visually, preventing calculation overlaps.
Click on the empty cell where you want the final percentage to appear.
Type the formula =COUNTIF(A2:A7,"W")/(COUNTA(A2:A7)-COUNTIF(A2:A7,"NA")), adjusting the range A2:A7 to match your actual data.
Press Enter to get the decimal result (for example, 0.4).
Select the result cell, navigate to the Home tab on the ribbon, and click the '%' (Percentage Style) button in the Number group to display the value as 40%.

Calculate Whole Number Percentage Without Formatting
Use this approach if you prefer to calculate and display the percentage as a standard whole number without using the native % formatting symbol.
Calculate Percentages Easily with WPS Spreadsheet
WPS Spreadsheet provides robust support for all standard Excel functions, including COUNTIF and COUNTA. You can calculate text percentages, exclude specific values, and cleanly format your data with just a few clicks.
- 1. Open your dataset: Launch WPS Spreadsheet and open your workbook containing the text values.
- 2. Enter the formula: Input =COUNTIF(A2:A7,"W")/(COUNTA(A2:A7)-COUNTIF(A2:A7,"NA")) in your desired output cell.
- 3. Apply Percentage Format: Go to the Home tab and click the % icon in the Number group to quickly format your decimal result into a clear percentage.

Frequently Asked Questions
Why does my formula result show as 4000% instead of 40%?
This happens when you multiply your formula by 100 (e.g., adding *100 at the end) and also apply the Excel Percentage format. The Percentage format automatically multiplies the background decimal by 100. To fix this, either remove the *100 from your formula or change the cell format back to General.
Can I exclude multiple different text values from the total count?
Yes. To exclude multiple text values from the denominator, you can subtract multiple COUNTIF functions. For example: COUNTA(A2:A7) - COUNTIF(A2:A7,"NA") - COUNTIF(A2:A7,"Pending").
What is the difference between COUNT and COUNTA in this formula?
The COUNT function only counts cells containing numeric values, whereas COUNTA counts cells containing any type of data, including text strings like 'W' or 'NA'. Since this scenario involves counting text entries, COUNTA is strictly required to find the total number of specified entries.




