Count Excel Commit Rows Across Tables with Power Query
Question details
Count valid commit records by team, application, month, and optionally team-member email using data from multiple Excel tables.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- A commit table must be checked against valid team-member and team-application tables before producing counts.
- Observed behavior
- The desired result is a grouped count containing only commits that meet the membership, application, and date criteria.
Identify the columns that link commits to valid team members and team-application combinations. Make sure email and team values use consistent spelling, and that commit dates are recognized as dates.
Merge and group the tables in Excel Power Query
Use this approach for large datasets when you need a refreshable count of valid commits.
Use the appropriate team and email keys for membership validation. If a commit does not contain a team, determine how its team should be assigned before grouping.
Ensure the lookup tables have unique rows for the keys being matched. Duplicate matches can multiply commit rows when a merged table is expanded.
Select each data range and choose Data > From Table/Range to load the commit, team-member, and team-application tables into Power Query.
In the commit query, choose Home > Merge Queries. Select the team and email columns in both tables, in the same order, and use an Inner join to retain matching records.
Choose Home > Merge Queries again and match the commit team and application columns to the corresponding columns in the valid team-application table. Use an Inner join to retain valid combinations.
Select the commit date column and set its data type to Date. Use its filter to limit the date range if needed, then choose Add Column > Date > Month > Start of Month to create a month grouping column.
Choose Home > Group By and use Advanced to group by team, application, and the new month column. Add email or workspace as a grouping column if needed, select Count Rows, and choose Home > Close & Load.

Count Valid Commit Records with WPS Spreadsheets
Use helper formulas to check team-member and team-application matches, then count valid commits by team, application, and month.
- 1. Arrange the source data: Open the workbook in WPS Spreadsheets. On the commit sheet, place dates, teams, applications, and emails in columns A through D. On a Members sheet, put teams in column A and emails in column B; on a ValidApps sheet, put teams in column A and applications in column B.
- 2. Flag valid commits: In cell E2 of the commit sheet, enter =--AND(COUNTIFS(Members!$A$2:$A$10000,B2,Members!$B$2:$B$10000,D2)>0,COUNTIFS(ValidApps!$A$2:$A$10000,B2,ValidApps!$B$2:$B$10000,C2)>0) and fill the formula down.
- 3. Enter summary criteria: On the commit sheet, enter a team in G2, an application in H2, and the first day of the target month as a date in I2.
- 4. Count matching rows: In J2, enter =COUNTIFS($E$2:$E$100000,1,$B$2:$B$100000,G2,$C$2:$C$100000,H2,$A$2:$A$100000,">="&I2,$A$2:$A$100000,"<"&EDATE(I2,1)). Adjust the formula ranges to include all source rows. Add an email criterion using column D if a per-member count is needed.

Frequently Asked Questions
Why use an Inner join for the lookup tables?
In Power Query's Merge Queries dialog, an Inner join keeps only commit rows with a matching lookup row. Use it for both the membership and team-application checks when both are required.
How do I count commits for each team member?
In Power Query, choose Home > Group By, select Advanced, and add email alongside team, application, and month. Use Count Rows as the aggregation.
Why are my counts higher after merging?
A lookup table may contain duplicate matching keys, causing rows to multiply when the merged data is expanded. Check and remove duplicate key combinations in the relevant lookup query before merging.
How can I count a single month's commits?
Filter the commit date column in Power Query to the desired date range, or group by a Start of Month column to produce counts for every month.




