Forum Discussion

JChapman-Cohen's avatar
JChapman-Cohen
Copper Contributor
Mar 29, 2023

Formulas with apostrophe

Hi,

 

I am doing an excel training course and  literally copying the formula word for word. Any formula that involves apostrophe comes back as an error. Why is this when it matches what is in my excel course?

Example formula below:

=DATEVALUE(''12-3-1987'')

 

Thanks all

Jo

4 Replies

  • JoeUser2004's avatar
    JoeUser2004
    Bronze Contributor

    JChapman-Cohen  wrote:  =DATEVALUE(''12-3-1987'')

     

    But it is even better to use DATE(1987, 12, 3) or DATE(1987, 3, 12), whichever you mean.

     

    And that's the point:  12-3-1987 is ambiguous.  Is that Dec 3 or Mar 12?

     

    Moreover, if you "share" (e.g. email) the workbook with someone that uses a different date form, the DATEVALUE formula will either return an error (e.g. if the date is 12-29-1987) or, worse, it will return an unintended date.

    • JChapman-Cohen's avatar
      JChapman-Cohen
      Copper Contributor
      Thank you, that's really helpful, i didn't appreciate how the formulas may not work correctly wither when sharing a workbook.
    • JChapman-Cohen's avatar
      JChapman-Cohen
      Copper Contributor

      HansVogelaar Ah ha!!!! thank you! What a simple mistake but that answered has fixed so many formula issues i was having! thank you so much.

Resources