Excel 2010 - Date/Time Formatting - Question About Symbols Used in Formatting.

I thought I knew all about date/time formatting but then I saw this:
"[$-409]m/d/yy h:mm AM/PM;@"

What does the [$-409] mean?
Why is it in square brackets?
What does the @ symbol mean?
brothertruffle880Asked:
Who is Participating?
 
Subodh Tiwari (Neeraj)Connect With a Mentor Excel & VBA ExpertCommented:
Custom number formatting has four segments for positive number, negative number, zero and text. And each one is separated by a semi-colon.
PositiveNumber;NegativeNumber;Zero;Text

To read more about custom number formatting, please go through the following link...
https://www.ablebits.com/office-addins-blog/2016/07/07/custom-excel-number-format/
1
 
Martin LissOlder than dirtCommented:
I think that both of them are meaningless since m/d/yy h:mm AM/PM gives the same results.
0
 
Subodh Tiwari (Neeraj)Connect With a Mentor Excel & VBA ExpertCommented:
[$-409] is used as the country's locate id set by Microsoft. And [$-409] represents USA.
For more info http://dailydoseofexcel.com/archives/2006/02/27/months-of-the-world/
And @ is normally used for text strings.
2
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
brothertruffle880Author Commented:
What's the significance of the semi-colon and the @ sign next to it?
0
 
brothertruffle880Author Commented:
What is the significance of the semi-colon and the @ sign next to it?
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Nothing specifically if you input a date time stamp in the cell with that custom format. You may remove the ;@ from the custom format string and that won't have any effect on the formatting of the date/time. As I already said that @ is used for text so in this case you may input either a date/time stamp or a string in the cell.
1
 
Martin LissConnect With a Mentor Older than dirtCommented:
Here's a Microsoft article that explains it. The article doesn't explicitly say so, but dates are considered numbers. In the case of your format statement the @ is the format to be used for positive numbers. @ essentially means "display it as is" so it's not needed,
1
 
brothertruffle880Author Commented:
Thanks to all for your valued assistance.  You made my life easier!
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome!
0
 
Martin LissOlder than dirtCommented:
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
              Experts Exchange Top Expert VBA (current)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.