Create an Excel Purchase Order Summary Table with COUNTIFS
Question details
Create a summary table that indicates whether each customer purchased specific items.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Purchase order data contains customer IDs and item columns marked Yes for purchased items.
- Observed behavior
- The desired summary shows Yes for each customer and item combination found in the purchase order data and leaves other cells blank.
Check which source column contains customer IDs and which columns contain item purchase flags. The example below assumes IDs are in Sheet1 column A and item flags begin in column D, with Yes marking a purchase.
Use COUNTIFS to mark purchased items by customer
Use this formula when each item has its own source column containing Yes for purchases.
The formula checks all source rows for the customer ID and a Yes flag in the selected item column. It returns Yes if at least one matching row exists; otherwise, it returns a blank.
On a summary sheet, enter customer IDs in column D starting at D2. Add item headings across row 1 starting at E1, in the same order as the item columns on Sheet1 starting at column D.
Select E2 and enter =IF(COUNTIFS(Sheet1!$A:$A,$D2,Sheet1!D:D,"Yes")>0,"Yes",""). Adjust the sheet name and column references if your data is arranged differently.
Drag the fill handle from E2 across the item columns and down the customer rows. The item column reference moves across, while the customer ID reference stays in column D.

Build the purchase order summary in WPS Spreadsheet
Open your workbook in WPS Spreadsheet and use the same COUNTIFS formula to mark items purchased by each customer.
- 1. Open the workbook: In WPS Spreadsheet, choose Open and select the Excel workbook containing your purchase order data.
- 2. Arrange the summary: On a summary sheet, enter customer IDs in column D starting at D2 and item headings across row 1 starting at E1, matching the source item columns.
- 3. Enter COUNTIFS: Select E2 and enter =IF(COUNTIFS(Sheet1!$A:$A,$D2,Sheet1!D:D,"Yes")>0,"Yes",""). Change the sheet name and references to match your workbook.
- 4. Fill and save: Drag E2's fill handle across and down to complete the table, then choose Save to save the workbook.

Frequently Asked Questions
What does the COUNTIFS formula check?
It checks Sheet1 column A for the customer ID in D2 and the selected item column for Yes. If both conditions occur in at least one row, the formula returns Yes.
Why does the formula return a blank for a customer?
A blank means COUNTIFS found no row matching both the customer ID and a Yes flag. Check the ID in the summary and the purchase flag in the corresponding Sheet1 item column.
How do I add more items to the summary?
Add item headings in the same order as the source item columns, then drag the formula's fill handle to the right. Check that each formula references the intended source column.
Can a PivotTable include customer addresses?
Yes, if the addresses are included in the PivotTable's source data. Select the source range, choose Insert > PivotTable, and add the address field to the table layout.




