To categorize data by date in Google Sheets, use the FILTER function with a date condition to pull matching rows into a new range, or add a helper column with a formula like =IF(A2>=DATE(2024,1,1),"Q1","Other") to label each row. Both approaches work without add-ons and update automatically when your data changes.
What You'll Need
- A Google account with access to Google Sheets (free).
- Your data in a sheet, with dates in a single column (e.g., column A).
- Dates must be real date values, not text. If they are text, convert them first (see Troubleshooting).
- Basic familiarity with cell references and formulas.
Step-by-Step
- Open your sheet and inspect the date column. Click a date cell and check the formula bar. If it shows a date like
2024-05-01or5/1/2024, it is a real date. If it shows text (e.g.,May 1, 2024left-aligned), you will need to convert it (see Troubleshooting). - Decide your categories. Common choices: by month, by quarter, by year, or by custom ranges (e.g., "Before June", "June", "After June"). Write them down so your formulas match.
- Add a helper column for labeling. In the first empty column to the right of your data (say column D), enter a header like
Category. In D2, enter a formula that assigns a label based on the date in A2. For example, to label by quarter:=IF(A2="","",IF(A2<DATE(2024,4,1),"Q1",IF(A2<DATE(2024,7,1),"Q2",IF(A2<DATE(2024,10,1),"Q3","Q4")))). Press Enter. - Copy the formula down. Drag the fill handle (small square at the bottom-right of D2) down to the last row of your data. Each row now has a category label.
- Create a summary table. In a separate area (e.g., F1:G5), list your categories in one column and use
COUNTIForSUMIFto aggregate. For example, in G2:=COUNTIF(D:D,F2)counts how many rows fall into the category in F2. For sums, use=SUMIF(D:D,F2,B:B)(assuming amounts are in column B). - Alternatively, use FILTER to extract rows by date range. In a new sheet or empty area, enter
=FILTER(A2:C, A2:A>=DATE(2024,1,1), A2:A<=DATE(2024,3,31))to get all rows with dates in Q1 2024. Adjust the range and dates as needed. The result spills automatically. - Format the output. Select the spilled range and apply date formatting or borders as desired. The FILTER result updates when source data changes.
- Test with a sample change. Edit a date in the source column and confirm the helper column and summary update correctly. If not, check for text dates or broken references.
Common Mistakes
- Using text instead of real dates. Formulas like
A2>DATE(2024,1,1)fail silently if A2 is text. Always verify with=ISDATE(A2)or by checking alignment (dates right-align by default). - Forgetting to lock ranges. When copying formulas, use absolute references (e.g.,
$A$2:$A$100) for fixed ranges to avoid misalignment. - Mismatched date formats. Google Sheets may interpret
01/02/2024as Jan 2 or Feb 1 depending on locale. UseDATE(year, month, day)to be unambiguous. - Overlooking blank cells. Blank dates can cause errors or miscategorization. Wrap formulas with
IF(A2="","",...)to handle them. - Assuming FILTER updates in real time. It does, but only if the source range is correct. If you insert rows above the range, it may not expand automatically; use open-ended ranges like
A2:Awhere possible.
Tips
- Use
EOMONTHto group by month-end:=EOMONTH(A2,0)returns the last day of the month, which you can then use in COUNTIFS. - For dynamic date ranges, reference cells instead of hardcoding dates:
=FILTER(A2:C, A2:A>=F1, A2:A<=G1)where F1 and G1 hold start and end dates. - Combine
QUERYfor SQL-like grouping:=QUERY(A2:C, "select A, sum(B) where A is not null group by A", 1)— but note QUERY requires dates in a recognized format. - Use conditional formatting to highlight rows by date category for quick visual checks.
- Keep a raw data sheet and a separate summary sheet to avoid accidental edits.
Troubleshooting
- Dates are text: Select the column, go to Format > Number > Date. If that does not work, use
=DATEVALUE(A2)in a helper column, then copy and paste as values. - Formula returns #VALUE!: Likely a text date or mismatched types. Check with
=ISNUMBER(A2)— real dates are numbers. - FILTER returns #N/A: No rows match the criteria. Verify your date range and that dates are real values.
- Summary counts are off: Ensure the helper column covers all rows and that COUNTIF ranges match exactly.
- Formulas break when sorting: Use absolute references or convert your data to a named range (Data > Named ranges) for stability.
Frequently Asked Questions
Can I categorize by week number?
Yes. Use =WEEKNUM(A2) in a helper column to get the week number, then group with COUNTIF or FILTER.
How do I group by month name?
Use =TEXT(A2,"mmmm") to get the full month name, or "mmm" for the abbreviation. Then use COUNTIF on that helper column.
Does FILTER work with dates in another sheet?
Yes, but you must reference the sheet name: =FILTER(Sheet2!A2:C, Sheet2!A2:A>=DATE(2024,1,1)).
Why does my date formula show a number like 45383?
That is the underlying date serial number. Format the cell as a date (Format > Number > Date) to display it normally.
Can I use pivot tables instead of formulas?
Yes. Pivot tables can group dates by month, quarter, or year without formulas. Select your data, then Insert > Pivot table, and drag the date field to Rows and set grouping.
What if my dates include times?
Use =INT(A2) to strip the time portion, then categorize on that helper column.