Is this an expected behaviour that month(ref) returns 12 when the ref is an empty cell?

I would have thought that this is a serious bug. Am I correct?

No mention of that behaviour in the official docs: https://support.google.com/docs/answer/3093052?hl=en

enter image description here


In fact, yes it is expected behavior. All of the time/date based formulas default to lowest/highest value when there is no real reference.


To prevent it, you are supposed to perform a simple logic check for real data:

=IF(LEN(A1), MONTH(A1), )
=IF(A1<>"", MONTH(A1), )

Also, Google Documentation is way too empty!

| improve this answer | |
  • 1
    Excellent answer – matcheek Jun 3 '19 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.