# How to calculate month end date in formula?

**URL:** <https://community.fibery.io/t/how-to-calculate-month-end-date-in-formula/2556>\
**Category:** Get Help\
**Created:** [February 16, 2022, 8:19pm UTC](https://community.fibery.io/t/how-to-calculate-month-end-date-in-formula/2556 "2022-02-16T20:19:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![masp](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@masp](https://community.fibery.io/u/masp)\
**Post date:** [February 16, 2022, 8:19pm UTC](https://community.fibery.io/t/how-to-calculate-month-end-date-in-formula/2556/1 "2022-02-16T20:19:06Z")

</div>

I have a [Done Date] field in my Task, and I need to derive the (year-specific) date of the end of the month form that date. So eg. if [Done Date] = February 5 2022, then I would derive [Month End Date] = February 28 2022. Is there an obvious way to achieve this?

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 16, 2022, 9:00pm UTC](https://community.fibery.io/t/how-to-calculate-month-end-date-in-formula/2556/2 "2022-02-16T21:00:50Z")

</div>

Just calculate the first of the next month and subtract a day:

```auto
Date(If(Month([Done Date]) = 12,Year([Done Date]) + 1,Year([Done Date])),If(Month([Done Date]) = 12,1,Month([Done Date]) + 1),1) - Days(1)

```

---

<div class="post-metadata">

**Author:** ![masp](https://avatars.discourse-cdn.com/v4/letter/m/46a35a/32.png) [@masp](https://community.fibery.io/u/masp)\
**Post date:** [February 16, 2022, 10:23pm UTC](https://community.fibery.io/t/how-to-calculate-month-end-date-in-formula/2556/3 "2022-02-16T22:23:20Z")

</div>

Perfect: thanks!!
