# Magic (or not) formula 😁

**URL:** <https://community.glideapps.com/t/magic-or-not-formula/44113>\
**Category:** Ask for Help\
**Created:** [July 8, 2022, 10:15am UTC](https://community.glideapps.com/t/magic-or-not-formula/44113 "2022-07-08T10:15:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.V\_Consulting\_SRL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/m.v_consulting_srl/32/3613_2.png) [@M.V\_Consulting\_SRL](https://community.glideapps.com/u/M.V_Consulting_SRL)\
**Post date:** [July 8, 2022, 10:15am UTC](https://community.glideapps.com/t/magic-or-not-formula/44113/1 "2022-07-08T10:15:01Z")

</div>

Hi everyone,  
Can I find ( with formula ) days numbers within a month based on a given date ?  
For example, I have July, 8 2022 . How many days are in July ? How could be calculated ?

Thank you,  
M.V.

---

<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:** [July 8, 2022, 10:22am UTC](https://community.glideapps.com/t/magic-or-not-formula/44113/2 "2022-07-08T10:22:14Z")

</div>

> [@Fun with Dates](https://community.glideapps.com/t/fun-with-dates/21684/134):
>
> Jean-Claude does not stop here hehe. Darren’s idea made me think about a formula to derive the current month’s number of days. And here we go! Tested some timestamps. N+31-(FLOOR(DAY(N)/16))\*15+1-DAY(N+31-(FLOOR(DAY(N)/16))\*15) - (N+1-DAY(N)) Edit: Realized a bug with 28 is that when you start with dates like 1, 2 in a 31-day month then it does not convert. Back to the drawing board. Edit 2: Derived a way to add 16 days when it’s “day 16 or more”, and 31 days when it’s “less than …

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [July 8, 2022, 11:51am UTC](https://community.glideapps.com/t/magic-or-not-formula/44113/3 "2022-07-08T11:51:31Z")

</div>

Hola!

Another trick (I think is simpler) is using the Excel plugin with _**DAY(EOMONTH({value},0))**_  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/a/caf86453e8f4d75717e26b19db5b7ec969a492aa.png)

The first step is to convert the Glide date into a text value and using Format Date plugin is the key.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/e/bec24f89a1c6eed507a01e8b94b95fe915b23fdb.png)

Later, use Excel plugin using this formula: _**DAY(EOMONTH({value},0))**_ and you have what you look for  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/d/6d788d3a6cf0d381d131d987266ef8f74cbcc693.png)

Saludos!

---

<div class="post-metadata">

**Author:** ![M.V\_Consulting\_SRL](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/m.v_consulting_srl/32/3613_2.png) [@M.V\_Consulting\_SRL](https://community.glideapps.com/u/M.V_Consulting_SRL)\
**Post date:** [July 8, 2022, 12:09pm UTC](https://community.glideapps.com/t/magic-or-not-formula/44113/4 "2022-07-08T12:09:29Z")

</div>

Thank You ! 🤟🎸🍻

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [July 9, 2022, 12:09pm UTC](https://community.glideapps.com/t/magic-or-not-formula/44113/5 "2022-07-09T12:09:45Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
