# Filter Dates that are equal to This Month

**URL:** <https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330>\
**Category:** Ask for Help\
**Created:** [March 6, 2022, 8:36pm UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330 "2022-03-06T20:36:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcmr1992](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lcmr1992/32/39997_2.png) [@lcmr1992](https://community.glideapps.com/u/lcmr1992)\
**Post date:** [March 6, 2022, 8:36pm UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/1 "2022-03-06T20:36:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [March 6, 2022, 8:50pm UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/2 "2022-03-06T20:50:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fluittsolutions](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fluittsolutions/32/30155_2.png) [@fluittsolutions](https://community.glideapps.com/u/fluittsolutions)\
**Post date:** [March 6, 2022, 8:55pm UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/3 "2022-03-06T20:55:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [March 6, 2022, 8:58pm UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/4 "2022-03-06T20:58:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [March 6, 2022, 9:31pm UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/5 "2022-03-06T21:31:41Z")

</div>

> [@fluittsolutions](#):
>
> I have to copy down that formula into the new rows.

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

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 7, 2022, 12:27am UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/6 "2022-03-07T00:27:43Z")

</div>

You can have a read here regarding arrayformula.

> [@Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts](https://community.glideapps.com/t/tutorial-arrayformula-in-google-sheets-good-practices-how-to-overcome-arrayformula-restrictions-with-scripts/9727):
>
> Hi, Today I will show you the script that can make copying formulas down work, when it does not work with arrayformula. But first, let’s have some introductions about arrayformula, for those who has not used this before in Google Sheets, some equivalents in Glide and some good practices while using it. I hope it can help you in building your Glide apps as well as applying it in your normal day job. 
> 
> > **1/ Definition**
> >
> > Arrayformula is defined as “a range, mathematical expression using one cell range …

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 7, 2022, 1:40am UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/7 "2022-03-07T01:40:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 7, 2022, 1:45am UTC](https://community.glideapps.com/t/filter-dates-that-are-equal-to-this-month/39330/8 "2022-03-07T01:45:36Z")

</div>

> [@Darren\_Murphy](#):
>
> ormat Date plugin for example, but that definitely _won’t_ work 100% of the time.

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