Formula Errors

How to Calculate the Percentage of Specific Values Excluding N/A in Excel

Algirdas JasaitisAlgirdas Jasaitis Nov 3, 2026 869 views

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').

How to Calculate the Percentage of Specific Values Excluding N/A in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the result cell

Click on the empty cell where you want the final percentage to appear.

2
Enter the formula

Type the formula =COUNTIF(A2:A7,"W")/(COUNTA(A2:A7)-COUNTIF(A2:A7,"NA")), adjusting the range A2:A7 to match your actual data.

3
Calculate the decimal

Press Enter to get the decimal result (for example, 0.4).

4
Apply percentage style

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%.

Use COUNTIF and COUNTA with Percentage Formatting
Avoid Multiplying by 100: If you multiply the formula by 100 and then apply the Percentage format, your result will incorrectly show as 4000%. Do not use *100 if you plan to use the native Percentage format.

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. 1. Open your dataset: Launch WPS Spreadsheet and open your workbook containing the text values.
  2. 2. Enter the formula: Input =COUNTIF(A2:A7,"W")/(COUNTA(A2:A7)-COUNTIF(A2:A7,"NA")) in your desired output cell.
  3. 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.
Fully compatible with Microsoft Excel formulas and number formatsIntuitive UI for applying Percentage formatting instantlyLightweight, fast, and completely free to use for daily tasks
microsoft office alternative - wps office

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.