I’m trying to use a drop down menu to pick a year value to summarize my date based on that year.
YEAR 2021 <== Drop Down Menu
DATE EMPLOYEE JOB # CITY
1/2/2020 JIM 25011 Statesville
3/4/2022 BOB 36054 Asheville
6/3/2021 LARRY 32009 Asheville
4/5/2024 LARRY 42027 Johnson City
8/4/2024 JIM 26026 Franklin
9/1/2023 JIM 28032 Greenville
10/3/2024 BOB 25013 Greenville
5/24/2021 LARRY 25019 Franklin
enter image description here
DATE is in Date format.
I tried: (in cell E4)
=QUERY(A4:D11,"SELECT A WHERE YEAR(A) = B1")
and I get an error: Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: B1
I tried:
=QUERY(A4:D11,"SELECT A WHERE YEAR(A) = 2024")
and it works.
What am I missing?
New contributor
Dan Gill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
With a slight modification to your current formula:
=QUERY(A4:D11,"SELECT A WHERE YEAR(A) = "&B1, 0)
3