Filter Dates that are equal to This Month

I’m creating an expense management app and I want to be able to see if the bill was already payed this month or not.

Currently I have the following collumns:

bill name | last payment date | amount.

So I have all payments registered and want to group itens that were already payed this month.

Any ideas?

extract month and year from a date… and use IF-Else column… use a math column month (now)… year(now)

I have done something similar for an entertainment app that allows users to filter events on a specific month. My data is in Google Sheets and includes a date/time column. I created a new column in the Google Sheet with the formula =TEXT(D2,“mmmm yyyy”) where D2 is the cell reference for the date/time column.

The original date column shows: 3/5/2022 6:45:00
The new column shows: March 2022.

Then to build a filter for my users, I used a choice component that shows a drop-down selection of all month/years to choose from.

My method isn’t as automatic as @Uzo because as I add multiple rows to the sheet, I have to copy down that formula into the new rows.

in google sheets, you can use arrayformula function, in glide… a math column

As @Uzo said, use an Arrayformula. Then, you won’t need to copy down formulas.

1 Like

You can have a read here regarding arrayformula.

My approach to this, which I’ve used over and over (and over) again:

  • Math column to extract the year: Year(Date)
  • Math column to extract the month index number: Month(Date)-1
  • Single Value column to fetch the Month name (see below)
  • Template column to stitch the month and year back together: {month} {year}

The above results in something like “Mar 2022” or “March 2022”.
For step 3 (the single value column), I have a list of month names in a lookup table, and the single value takes the month index “from start” to get the correct month name.

4 columns might seem a little overkill for something like this, but it’s solid and it works 100% of the time. You could achieve the same thing with a single column using the Format Date plugin for example, but that definitely won’t work 100% of the time.

4 Likes

I would stay very far away from it haha. Yours definitely is a safe choice.

1 Like