Thủ Thuật
  • TOP Thủ Thuật
    • Thủ Thuật Internet
    • Thủ Thuật Máy Tính
    • Thủ Thuật Tiện Ích
    • Thủ Thuật Phần Mềm
  • Chia Sẻ Kiến Thức
    • Học Excel
    • Học Word
    • Học Power Point
  • Games
  • Kênh Công Nghệ
  • Facebook
  • WordPress
  • SEO
No Result
View All Result
Thủ Thuật
  • TOP Thủ Thuật
    • Thủ Thuật Internet
    • Thủ Thuật Máy Tính
    • Thủ Thuật Tiện Ích
    • Thủ Thuật Phần Mềm
  • Chia Sẻ Kiến Thức
    • Học Excel
    • Học Word
    • Học Power Point
  • Games
  • Kênh Công Nghệ
  • Facebook
  • WordPress
  • SEO
No Result
View All Result
Thủ Thuật
No Result
View All Result
Home Chia Sẻ Kiến Thức Học Excel

Master Excel: How to Count with Multiple Conditions Using SUMPRODUCT

Master Excel: How to Count with Multiple Conditions Using SUMPRODUCT
6k
SHARES
19.5k
VIEWS
Share on Facebook

Nội Dung Bài Viết

Toggle
  • Understanding the Logic of SUMPRODUCT
    • How It Counts
  • Practical Application: Counting with Multiple Criteria
    • The Dataset
    • Example 1: Counting Specific Products in a Specific Month
    • Example 2: Advanced Counting with Three Conditions
  • Why Use SUMPRODUCT Instead of COUNTIFS?
  • Conclusion

While the COUNTIFS function is the standard go-to for counting data based on criteria in Excel, it has its limitations—particularly when dealing with arrays or transforming data within the formula itself (such as extracting a month from a date). This is where the SUMPRODUCT function shines.

At Thủ Thuật, we believe in mastering versatile tools. SUMPRODUCT is not just for multiplication; it is a powerhouse for array processing that can handle complex counting logic where other functions fail. This guide will walk you through how to utilize SUMPRODUCT to count with multiple conditions, offering you a more flexible way to analyze your data.

Understanding the Logic of SUMPRODUCT

To master this technique, it is essential to understand how SUMPRODUCT processes data. Unlike standard counting functions, SUMPRODUCT handles arrays naturally.

The basic syntax is:

=SUMPRODUCT(array1, [array2], [array3], …)

How It Counts

The “secret” to using this function for counting lies in Boolean logic. When you set a condition in Excel (e.g., A1="Apple"), the result is either TRUE or FALSE.

  • TRUE is equivalent to 1.
  • FALSE is equivalent to 0.

By multiplying these conditions together, SUMPRODUCT checks if all criteria are met for a specific row. If a row meets all conditions (1 * 1 * 1), the result is 1. If it fails even one condition (1 * 0 * 1), the result is 0. Finally, the function sums up these 1s to give you the total count.

Xem thêm:  Kết Hợp VLOOKUP, SUM và SUMIF trong Excel: Hướng Dẫn Chi Tiết

Practical Application: Counting with Multiple Criteria

Let’s dive into a practical scenario to see this function in action. We will use a sales dataset containing dates, shift numbers, product names, and quantities.

The Dataset

Below is an animation showing how data is typically selected in these operations, followed by our static dataset for this tutorial.

Animation demonstrating the selection of data ranges in Excel for SUMPRODUCT formulasAnimation demonstrating the selection of data ranges in Excel for SUMPRODUCT formulas

Our specific dataset includes columns for Date (Ngày), Shift (Ca), Product Name (Tên hàng), and Quantity (Số lượng).

Spreadsheet table showing columns for Date, Shift, Product Name, and Quantity with sample sales dataSpreadsheet table showing columns for Date, Shift, Product Name, and Quantity with sample sales data

Example 1: Counting Specific Products in a Specific Month

The Challenge: We need to count how many times “Cam” (Orange) was sold specifically in June.

The Analysis:

  1. Condition 1 (Product): Look at column C (“Tên hàng”) for the text “Cam”.
  2. Condition 2 (Time): Look at column A (“Ngày”). However, the data is in full date format (dd/mm/yyyy). We need to extract just the month using the MONTH() function.

Note: This is a scenario where COUNTIFS often struggles because it cannot process MONTH(Range) directly inside its arguments without a helper column.

The Formula:

=SUMPRODUCT((C2:C18="Cam")*(MONTH(A2:A18)=6)*1)

Breakdown:

  • (C2:C18="Cam"): Creates an array of TRUE/FALSE for the product name.
  • (MONTH(A2:A18)=6): Extracts the month from column A and checks if it equals 6 (June).
  • *: The multiplication operator acts as an “AND” logic gate.
  • *1: Ensures the final Boolean result is coerced into a number (though the multiplication between two arrays usually handles this, adding *1 is a safe habit to ensure numeric conversion).

Pro Tip: Always lock your reference ranges (using F4 to add $ signs, e.g., $C$2:$C$18) if you plan to drag the formula to other cells.

Xem thêm:  Cách Comment Code trong VBA: Hướng dẫn Chi Tiết

Excel screenshot showing the SUMPRODUCT formula result for counting Oranges sold in JuneExcel screenshot showing the SUMPRODUCT formula result for counting Oranges sold in June

Example 2: Advanced Counting with Three Conditions

The Challenge: We need to count the number of times “Táo” (Apple) was sold in Shift 1 during June.

The Analysis:
We are now layering three distinct criteria:

  1. Shift: Column B must equal 1.
  2. Month: Column A must be June (6).
  3. Product: Column C must be “Táo”.

The Formula:

=SUMPRODUCT(($B$2:$B$18=1)*(MONTH($A$2:$A$18)=6)*($C$2:$C$18="Táo")*1)

As you can see, adding criteria does not complicate the logic; it simply extends the multiplication chain. Each condition is enclosed in parentheses and multiplied by the next.

Excel screenshot showing the result for counting Apples sold in Shift 1 during JuneExcel screenshot showing the result for counting Apples sold in Shift 1 during June

Why Use SUMPRODUCT Instead of COUNTIFS?

While COUNTIFS is faster for simple matches, SUMPRODUCT offers superior flexibility:

  • Data Transformation: You can modify the data range (like extracting a Year or Month) directly within the formula.
  • Complex Logic: It handles “OR” logic (using + instead of *) more intuitively than COUNTIFS in a single cell.
  • Array Handling: It is designed for matrix calculations, making it a favorite for advanced modeling.

Conclusion

The SUMPRODUCT function is an incredibly powerful tool for anyone looking to go beyond basic Excel counting. By understanding how to multiply logical conditions, you can extract precise insights from your data without the need for messy helper columns.

Whether you are tracking inventory, analyzing sales shifts, or managing project timelines, mastering this function will significantly enhance your spreadsheet efficiency. We encourage you to experiment with these formulas on your own datasets to fully grasp their potential.

For more advanced Excel techniques and technology tips, keep following Thủ Thuật.

Đánh Giá Bài Viết
Tuyết Nhi

Tuyết Nhi

Tôi là Tuyết Nhi - Nữ phóng viên trẻ đến từ Hà Nội. Với niềm đam mê công nghệ, khoa học kỹ thuật, tôi yêu thích và muốn chia sẻ đến mọi người những trải nghiệm, kinh nghiệm về các lĩnh vực công nghệ, kỹ thuật... Rất mong được quý độc giả đón nhận ❤️.

Related Posts

How to Generate Unique Random Numbers in Excel: A Comprehensive Guide
Học Excel

How to Generate Unique Random Numbers in Excel: A Comprehensive Guide

Master the Excel ERROR.TYPE Function to Categorize and Fix Formula Errors
Học Excel

Master the Excel ERROR.TYPE Function to Categorize and Fix Formula Errors

How to Print A5 Pages on A4 Paper: A Complete Guide
Học Excel

How to Print A5 Pages on A4 Paper: A Complete Guide

How to Create a Professional Plan vs. Actual Chart in Excel
Học Excel

How to Create a Professional Plan vs. Actual Chart in Excel

Discussion about this post

Trending.

Trích Xuất Dữ Liệu từ Báo Cáo Power BI Đã Xuất Bản Trên Web

Trích Xuất Dữ Liệu từ Báo Cáo Power BI Đã Xuất Bản Trên Web

Hướng Dẫn Cách Livestream Trên Facebook Bằng Điện Thoại Và Máy Tính Đơn Giản, Sắc Nét Từ A-Z

Hướng Dẫn Cách Livestream Trên Facebook Bằng Điện Thoại Và Máy Tính Đơn Giản, Sắc Nét Từ A-Z

World War 2: Strategy Games – Game Chiến Thuật Thế Chiến II Hấp Dẫn Trên Mobile

World War 2: Strategy Games – Game Chiến Thuật Thế Chiến II Hấp Dẫn Trên Mobile

Download Your Uninstaller Pro 7.5 Full Key 2025 – Giải Pháp Gỡ Cài Đặt Phần Mềm Tận Gốc

Download Your Uninstaller Pro 7.5 Full Key 2025 – Giải Pháp Gỡ Cài Đặt Phần Mềm Tận Gốc

Hướng dẫn Đọc Số thành Chữ trong Google Sheets với Add-on Docso

Hướng dẫn Đọc Số thành Chữ trong Google Sheets với Add-on Docso

Giới Thiệu

Thủ Thuật

➤ Website đang trong quá trình thử nghiệm AI biên tập, mọi nội dung trên website chúng tôi không chịu trách nhiệm. Bạn hãy cân nhắc thêm khi tham khảo bài viết, xin cảm ơn!

Chuyên Mục

➤ TOP Thủ Thuật

➤ Chia Sẻ Kiến Thức

➤ Kênh Công Nghệ

➤ SEO

➤ Games

Liên Kết

➤ Ketquaxskt.com

➤ TOP Restaurants

➤ Here Restaurant

➤

➤

Liên Hệ

➤ TP. Hải Phòng, Việt Nam

➤ 0931. 910. JQK

➤ Email: [email protected]

Website này cũng cần quảng cáo, không có tiền thì viết bài làm sao  ” Đen Vâu – MTP ”

DMCA.com Protection Status

© 2025 Thủ Thuật - Website chia sẻ kiến thức công nghệ hàng đầu Việt Nam

No Result
View All Result
  • TOP Thủ Thuật
    • Thủ Thuật Internet
    • Thủ Thuật Máy Tính
    • Thủ Thuật Tiện Ích
    • Thủ Thuật Phần Mềm
  • Chia Sẻ Kiến Thức
    • Học Excel
    • Học Word
    • Học Power Point
  • Games
  • Kênh Công Nghệ
  • Facebook
  • WordPress
  • SEO

© 2025 Thủ Thuật - Website chia sẻ kiến thức công nghệ hàng đầu Việt Nam