Function Problems

WPS Spreadsheet: Count Exact A and P Letters Without Counting Initials

Aamir Naveed AkramAamir Naveed Akram Nov 12, 2026 869 views

Question details

The user needs to count cells whose complete values are exactly A or P, without counting those letters when they appear inside longer values.

Product
WPS Spreadsheets
Device & OS
not provided
Scenario
A row contains shift or attendance codes such as A, P, AB, or PA, and the user wants separate counts for exact A and P entries.
Observed behavior
LEN or wildcard-based counting can include letters inside longer cell values, producing inflated results.
Before you start

Confirm the cells use consistent codes and identify the range to check, such as A1:Z1. Remove unintended leading or trailing spaces if exact entries are not being recognized.

Solution 1Recommended

Use COUNTIF with an exact letter criterion

Use this method when each target cell must contain only A or only P, with longer values such as AB and PA excluded.

COUNTIF compares each cell with the complete criterion when the criterion contains no wildcard characters. Therefore, "A" matches only a cell whose value is A, not a cell containing A as part of another value.

1
Select the result cell

In WPS Spreadsheets, click the cell where you want to display the count for the A entries.

2
Enter the exact A formula

Type =COUNTIF(A1:Z1,"A") in the formula bar or directly in the cell, then press Enter. Replace A1:Z1 with your actual range.

3
Count exact P entries

In another result cell, enter =COUNTIF(A1:Z1,"P") and press Enter to count cells containing only P.

4
Check the results

Review the source range to confirm that values such as AB, PA, or other names are not included in either count.

Exact matching result: The formulas count only cells equal to A or P and ignore longer values that merely contain those letters.

Count Exact Shift Letters Quickly in WPS Spreadsheets

WPS Spreadsheets lets you use COUNTIF to count complete cell values such as A or P, excluding longer codes and initials. Its familiar formula tools make the workbook easy to update and share.

  1. 1. Open the spreadsheet: Launch WPS Office and open the workbook in WPS Spreadsheets.
  2. 2. Choose a result cell: Click an empty cell beside the source range where you want the exact A count to appear.
  3. 3. Enter the A formula: Type =COUNTIF(A1:Z1,"A") and press Enter, changing the range to match your data.
  4. 4. Enter the P formula: In a second empty cell, type =COUNTIF(A1:Z1,"P") and press Enter.
Counts exact A and P entries without matching letters inside longer valuesSupports COUNTIF and case-sensitive EXACT formulas for flexible data validationWorks with Microsoft Excel XLS and XLSX spreadsheet formatsProvides a familiar, lightweight spreadsheet interface for everyday calculations
microsoft office alternative - wps office

Frequently Asked Questions

Why does COUNTIF with "A" exclude values such as AB?

The criterion "A" requires the complete cell value to equal A. Because no wildcard is used, COUNTIF does not match AB, PA, or other longer values.

What formula counts exact P entries in a row?

Use =COUNTIF(A1:Z1,"P") in WPS Spreadsheets. Replace A1:Z1 with the range that contains your shift or attendance codes.

Does COUNTIF distinguish uppercase A from lowercase a?

No. COUNTIF is generally case-insensitive. To count uppercase A only, use =SUMPRODUCT(--EXACT(A1:Z1,"A")); use the equivalent formula with P for uppercase P.

Why is an exact letter not being counted?

Check for leading or trailing spaces, hidden characters, or different capitalization. Clean the cell contents or use the case-sensitive EXACT formula when capitalization is important.