Forum Discussion
shivom400
Jun 03, 2022Copper Contributor
mysterious bug w/ date formula that is not working
I am trying to recall the end of the month based off a day in a month, however the same formula (and format) is only working in some rows and not in others. Looking for an expert that can help take ...
Riny_van_Eekelen
Jun 03, 2022Platinum Contributor
shivom400 Please show the formula and the context in which you show it.
shivom400
Jun 03, 2022Copper Contributor
=IFERROR(EOMONTH(DATE(YEAR(K10),DAY(K10),MONTH(K10)),0),"--")
for this formula the value in k10 is 01/03/2022, where the format is DD/MM/YYYY
for this formula the value in k10 is 01/03/2022, where the format is DD/MM/YYYY
- shivom400Jun 03, 2022Copper ContributorI'm also using Month() to get the month of 04/03/2022 but it is showing month as 4 despite the date being formatted as DD/MM/2022 and so it should be showing 3
- Riny_van_EekelenJun 03, 2022Platinum Contributor
shivom400 You should be able to use:
=EOMONTH(K10,0)provided that the value in K10 is a real date.
On your other issue, it seems that your system is set up to work with the mm/dd/yyyy format. Merely changing the display format doesn't change the second element to the month. In other words, a US style date 04/03/2022 = April 3, 2022. You may format it European style to display 03/04/2022, but it will still be 3 April 2022. Hence, the MONTH = 4.