[Solved] Autofilter by Year/Month of date column

Discuss the spreadsheet application
Locked
Calab
Posts: 4
Joined: Wed Mar 13, 2024 12:27 am

[Solved] Autofilter by Year/Month of date column

Post by Calab »

I have a sheet containing my bank transactions. Column "C" is a date formatted column containing the date of each transaction.

I would like to have a dropdown autofilter that allows me to choose from all the YEAR-MONTH combinations found on the sheet. This would show me all the transactions that occurred during the chosen month of a year.

This should be possible... is it? How could I do this?

I am a newbie when it comes to working with a spreadsheet. All I have figured out so far is something like =YEAR(C2)&"-"&TEXT(MONTH(C2);"00") but I have no idea how to do this.
Last edited by Calab on Wed Mar 13, 2024 3:54 am, edited 1 time in total.
OpenOffice 4.1.15 on Windows 11
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Autofilter by Year/Month of date column

Post by robleyd »

This is a job for a pivot table. OpenOffice documentation [PDF] is at Calc Guide - Using a pivot table

There is also some good information at Pivot tables and there is an associated Tutorial
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
Calab
Posts: 4
Joined: Wed Mar 13, 2024 12:27 am

Re: Autofilter by Year/Month of date column

Post by Calab »

robleyd wrote: Wed Mar 13, 2024 12:55 am This is a job for a pivot table. OpenOffice documentation [PDF] is at Calc Guide - Using a pivot table

There is also some good information at Pivot tables and there is an associated Tutorial
From what I've seen with a quick look, is that the pivot tables will sum my columns up.

I need to retain each transaction on it's own so I can categorize each transaction.

I would just like to see the data one month at a time.
OpenOffice 4.1.15 on Windows 11
FJCC
Moderator
Posts: 9284
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Autofilter by Year/Month of date column

Post by FJCC »

Please upload a small example file. The easiest way to make the file might be to make a copy of your actual file, delete most of the data and change any remaining confidential information. To upload a file, click Post Reply and look for the Attachments tab just below the box where you type a response.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Calab
Posts: 4
Joined: Wed Mar 13, 2024 12:27 am

Re: Autofilter by Year/Month of date column

Post by Calab »

I ended up inserting a column and used =TEXT(YEAR(C2);"00") & "-" & TEXT(MONTH(C2); "00") in cell D2. Then I copied that cell down the entire column. Autofilter works fine on that column.
OpenOffice 4.1.15 on Windows 11
User avatar
karolus
Volunteer
Posts: 1160
Joined: Sat Jul 02, 2011 9:47 am

Re: Autofilter by Year/Month of date column

Post by karolus »

Calab wrote: Wed Mar 13, 2024 2:45 am I ended up inserting a column and used =TEXT(YEAR(C2);"00") & "-" & TEXT(MONTH(C2); "00") in cell D2. Then I copied that cell down the entire column. Autofilter works fine on that column.
Of course:

Code: Select all

=TEXT(C2;"YY-MM")
or
=TEXT(C2;"YYYY-MM")
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
Locked