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

Mastering Excel SUMIFS: How to Sum Values by Month and Year Efficiently

Mastering Excel SUMIFS: How to Sum Values by Month and Year Efficiently
6k
SHARES
19.5k
VIEWS
Share on Facebook

Nội Dung Bài Viết

Toggle
  • Understanding the Date Logic in Excel
  • Analyzing the Real-World Scenario
  • Constructing the Advanced SUMIFS Formula
    • 1. Defining the Sum Range and Static Criteria
    • 2. Handling Dynamic Time Conditions (Start and End Date)
    • 3. The Preliminary Formula
  • Optimizing with Absolute and Mixed References
    • The Final, Robust Formula
  • Important Considerations and Best Practices
  • References

In the realm of data analysis and accounting, the SUMIFS function stands as one of the most robust tools in Microsoft Excel’s arsenal. It empowers users to aggregate values based on multiple specific criteria, making it indispensable for creating complex summary reports related to timeframes, personnel performance, or product categories.

However, a significant challenge often arises due to the discrepancy between the format of raw source data and the requirements of the final report. A classic example involves source data that records transactions by specific dates (e.g., dd/mm/yyyy), while the management report requires a summation by Month and Year. Since SUMIFS requires conditions that directly correspond to the data range, you cannot simply ask Excel to match a specific date against a generic “Month” number without a strategic formula.

This guide will provide a deep dive into customizing time-based conditions within SUMIFS, allowing you to solve this matrix reporting problem accurately and professionally.

Understanding the Date Logic in Excel

To successfully apply SUMIFS to time-series data, one must first grasp how Excel handles dates and conditional logic. SUMIFS operates on the principle of exact matching or range-based matching.

If your “Criteria Range” contains full dates (e.g., January 15, 2025), but your condition is simply the number “1” (representing January), Excel will not intuitively know to sum all days falling within that month. It views the date as a specific serial number and the month as a different, unrelated value.

The most optimal solution is to shift your mindset from looking for a “Month” to defining a “Time Range.” To calculate total sales for January 2012, for instance, we must instruct Excel to sum values that satisfy two simultaneous conditions:

  1. The transaction date is greater than or equal to the first day of the month (01/01/2012).
  2. The transaction date is strictly less than the first day of the following month (01/02/2012).

By “sandwiching” the data between these two dates, we capture every single transaction in January, regardless of whether the month has 28, 30, or 31 days.

Analyzing the Real-World Scenario

Let’s visualize a specific scenario to understand the workflow. Imagine you are managing a sales dataset and need to generate a matrix report that summarizes revenue by employee, spread across various months and years.

The Input Data Structure:

  • Column A (Date): Contains the transaction dates (formatted as dd/mm/yyyy).
  • Column B (Product): The name of the item sold.
  • Column C (Staff): The name of the salesperson.
  • Column D (Amount): The revenue value of the transaction.
Xem thêm:  Hàm WEEKDAY trong Excel: Xác Định Thứ Trong Tuần

The Goal: Create a dynamic summary table (Matrix) where rows represent Months, columns represent Years, and the data is filtered for a specific employee (e.g., selected in cell H2).

Detailed Excel spreadsheet showing raw sales data on the left and a summary report structure by month and year on the rightDetailed Excel spreadsheet showing raw sales data on the left and a summary report structure by month and year on the right

To achieve this, we will combine the SUMIFS function with the DATE function to generate dynamic time milestones that adjust automatically as we drag the formula across the table.

Constructing the Advanced SUMIFS Formula

We will build the formula in the cell where a specific Month intersects with a specific Year (e.g., cell G4 in our example). Let’s break down the syntax of SUMIFS(sum_range, criteria_range1, criteria1, ...) component by component.

1. Defining the Sum Range and Static Criteria

The first part of the formula handles the values we want to add up and the fixed criteria (the employee name).

  • Sum_range: This is the column containing the financial figures, which is D4:D31.
  • Criteria_range1: This is the column containing employee names, C4:C31.
  • Criteria1: The specific employee we are reporting on, located in cell H2.

2. Handling Dynamic Time Conditions (Start and End Date)

Since our raw data does not have separate columns for “Month” and “Year,” we must use the Date column (Column A) as the criteria range for both the start and end of the period.

We need a way to generate the “First Day of the Month” based on the Year header (Row 3) and the Month label (Column F). The DATE(Year, Month, Day) function is perfect for this:

  • DATE(G3, F4, 1): This returns the 1st day of the month listed in F4, for the year listed in G3.

Setting up the logic:

  • The “Start Date” Condition:
    • Criteria_range2: The Date Column (A4:A31).
    • Criteria2: Must be greater than or equal to the 1st of the month.
    • Syntax: ">=" & DATE(G3, F4, 1)
  • The “End Date” Condition:
    • Criteria_range3: The Date Column (A4:A31).
    • Criteria3: Must be strictly less than the 1st day of the next month.
    • Syntax: "<" & DATE(G3, F4 + 1, 1)

Note: The DATE function is intelligent. If you calculate DATE(2025, 12 + 1, 1), Excel automatically converts this to January 1, 2026. This eliminates the need for complex “End of Year” logic.

3. The Preliminary Formula

Combining these elements, the formula for cell G4 (before applying absolute references) would look like this:

=SUMIFS(D4:D31, C4:C31, H2, A4:A31, ">="&DATE(G3,F4,1), A4:A31, "<"&DATE(G3,F4+1,1))

Optimizing with Absolute and Mixed References

The formula above works for a single cell. However, for a matrix report, you need to drag this formula across 12 months and potentially multiple years. Without locking specific cell references using the dollar sign ($), the formula will break.

Xem thêm:  Cách Nhân Dải Dữ Liệu với một Số trong Excel

Here is the logic for locking references (Absolute vs. Mixed):

  1. Source Data Ranges ($): The columns in your raw data table (D4:D31, C4:C31, A4:A31) must never move. We use absolute references for these.
    • Result: $D$4:$D$31, $C$4:$C$31, $A$4:$A$31.
  2. Employee Criteria ($): The target employee name is always in cell H2.
    • Result: $H$2.
  3. The Year Reference (Row Lock): When you drag the formula down to other months, the reference to the Year (Row 3) must stay fixed. However, when dragging right to the next year, the column should change (G to H).
    • Result: G$3 (Lock the Row).
  4. The Month Reference (Column Lock): When you drag the formula right to other years, the reference to the Month (Column F) must stay fixed. When dragging down, the row should change.
    • Result: $F4 (Lock the Column).

The Final, Robust Formula

Applying these reference rules results in a professional-grade formula ready for deployment:

=SUMIFS($D$4:$D$31, $C$4:$C$31, $H$2, $A$4:$A$31, ">="&DATE(G$3, $F4, 1), $A$4:$A$31, "<"&DATE(G$3, $F4+1, 1))

Implementation Steps:

  1. Copy the formula above into cell G4.
  2. Fill Right: Drag the fill handle to the right to cover all required years.
  3. Fill Down: With the row selected, drag the fill handle down from Month 1 to Month 12.

You have now created a fully automated dynamic report that updates instantly if the source data or the selected employee changes.

Important Considerations and Best Practices

Using SUMIFS in conjunction with DATE and comparison operators (>=, <) is a foundational technique for time-series analysis in Excel. This method is superior to using helper columns because it keeps your raw data clean and reduces file size.

To ensure your reports are error-free, keep the following tips in mind:

  • Data Integrity: Ensure column A in your source data is formatted strictly as Date. If these cells are formatted as Text, the comparison operators will fail, resulting in zero values.
  • Reference Checking: The most common cause of errors in matrix tables is misplaced $ signs. If your numbers look wrong, check if the Month reference ($F4) or Year reference (G$3) has shifted incorrectly.
  • Flexibility: This logic is not limited to months. You can adapt the DATE math to report by Quarter, Week, or Fiscal Year.
  • Alternative Criteria: While this example filters by “Staff,” you can easily swap the Criteria_range1 to filter by “Product” or “Region” to suit different reporting needs.

Mastering this technique elevates your Excel skills from basic data entry to professional data modeling. We encourage you to download the sample file and practice building the formula from scratch to fully internalize the logic.

References

For further study and to access the practice files mentioned in this tutorial, please consult the following resources:

  • Sample Excel File: Download via Google Drive
  • Video Tutorial: Watch on YouTube
  • Excel Online Learning: Explore advanced functions for accounting and HR management.

By applying these methods, you will significantly reduce the time spent on manual reporting and increase the accuracy of your financial or operational insights.

Đá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