
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why MonthEnd don't work in this case?
I wonder how I compare two dates when I use the function monthend, when using in an if statement always gives false, for example:
=if(monthend('31/10/2013') = '31/10/2013', 1,0)
Thank you.
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It will work
=if(Floor(monthend('31/10/2013')) = Num(Date('31/10/2013')), 1,0)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monthend is the timestamp of the last ms. Floor(monthend(...))= or Date must be used.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monthend returns a numeric date, but needs a numeric date as input. You're comparing it to a string. That comparison will always return False. You need to turn the strings into a dates using the date# function:
=if(floor(monthend(date#('31/10/2013','DD/MM/YYYY'))) = date#('31/10/2013','DD/MM/YYYY'), 1,0)
talk is cheap, supply exceeds demand

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Worked for a fixed date, but when I put the script, using a date in a table, all return 0 ...:
if(floor(monthend(date#(DATA,'DD/MM/YYYY'))) = date#(DATA,'DD/MM/YYYY'), 1,0)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Convert both as number and check it.
Hope tat helps
Please close the thread by marking correct answer & give likes if you like the post.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Worked in an expression within a list, but in the script all dates were 0


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It will work
=if(Floor(monthend('31/10/2013')) = Num(Date('31/10/2013')), 1,0)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
