Excel : how to put a literal dot into a cell format
Whenever I put a dot character into a custom cell format Excel will interpret it as if I want a decimal separator in that location of the format. The problem being that decimal separator changes with the locale. I actually just want a dot.
Here's an example format that won't work:
hh:mm:ss.000
(it won't work because if the locale uses anything else than a dot as a decimal separator then you'll see something like 22:31:34,854 in your formatted value)
I've tried something like
hh:mm:ss.000
to make Excel understand that I really want a dot. However Excel 2010 refuses to accept that as a valid format. (I've read somewhere that the is the way to escape a character in an Excel format string)
UPDATE (AND A KIND OF ANSWER)
The official documentation from Microsoft says that you can get a format to print a character that would otherwise be interpreted as a meta-character by placing the character in double quotation marks or by escaping it with a backslash. For example the following format #.##0. will format 1234 as 1.234. on a US locale. Although the example is nonsense this proves that escaping the period character actually works.
So why won't it work when creating a timestamp format with milliseconds ?
The answer lies in the way that Microsoft designed the format specifiers. Those meta characters (like 0 (zero)) have different interpretation depending on their surroundings. In some context 0 means to always have a digit in that location. So placing three zeros in a format, as in #0.000, means to format 12 as 12.000. However when the three zeroes are placed after a time format they are interpreted as meaning "milliseconds". If we escape the period just before the three zeroes then the three zeroes are no longer "near" the time format specifiers and Excel gets confused and can no longer determine if we mean "milliseconds" or digit placeholder. Hence it has no option than to refuse the format. At least this is my interpretation of why it doesn't work.
This ambiguity in the format meta chars is really the root of all evil. If you compare to various programming languages I've never before seen that format string meta chars can have different interpretation depending on context. In this case it means that there's no way that Excel can create a time format will milliseconds the way it supposed to look. You'll simply have to accept that the period char may mysteriously change to , sometimes (depending on the user's locale settings).
microsoft-excel microsoft-excel-2010
|
show 2 more comments
Whenever I put a dot character into a custom cell format Excel will interpret it as if I want a decimal separator in that location of the format. The problem being that decimal separator changes with the locale. I actually just want a dot.
Here's an example format that won't work:
hh:mm:ss.000
(it won't work because if the locale uses anything else than a dot as a decimal separator then you'll see something like 22:31:34,854 in your formatted value)
I've tried something like
hh:mm:ss.000
to make Excel understand that I really want a dot. However Excel 2010 refuses to accept that as a valid format. (I've read somewhere that the is the way to escape a character in an Excel format string)
UPDATE (AND A KIND OF ANSWER)
The official documentation from Microsoft says that you can get a format to print a character that would otherwise be interpreted as a meta-character by placing the character in double quotation marks or by escaping it with a backslash. For example the following format #.##0. will format 1234 as 1.234. on a US locale. Although the example is nonsense this proves that escaping the period character actually works.
So why won't it work when creating a timestamp format with milliseconds ?
The answer lies in the way that Microsoft designed the format specifiers. Those meta characters (like 0 (zero)) have different interpretation depending on their surroundings. In some context 0 means to always have a digit in that location. So placing three zeros in a format, as in #0.000, means to format 12 as 12.000. However when the three zeroes are placed after a time format they are interpreted as meaning "milliseconds". If we escape the period just before the three zeroes then the three zeroes are no longer "near" the time format specifiers and Excel gets confused and can no longer determine if we mean "milliseconds" or digit placeholder. Hence it has no option than to refuse the format. At least this is my interpretation of why it doesn't work.
This ambiguity in the format meta chars is really the root of all evil. If you compare to various programming languages I've never before seen that format string meta chars can have different interpretation depending on context. In this case it means that there's no way that Excel can create a time format will milliseconds the way it supposed to look. You'll simply have to accept that the period char may mysteriously change to , sometimes (depending on the user's locale settings).
microsoft-excel microsoft-excel-2010
2
What exactly do you want to accomplish as end result?
– LPChip
Aug 24 '15 at 18:38
I hope that was obvious: I want to format a time value with milliseconds. The problem I have is that Excel will interpret the.in the format string as meaning decimal separator rather than simply just printing a dot.
– peterh
Aug 24 '15 at 20:12
I am able to use hh:mm:ss.000 format just fine on a cell for time what version of excel are you using?
– Matthew Lozoya
Aug 25 '15 at 5:25
It's not about being able to use thehh:mm:ss.000format, it's about being sure that the dot is really a dot. I bet you didn't test on a locale where your decimal separator is say a comma ?? If so you would notice that Excel would print your formatted timeval as something like06:33:55,872and that is not what I want. I just want a dot (literally). As indicated in the question I'm using Excel 2010.
– peterh
Aug 25 '15 at 14:58
answers.microsoft.com/en-us/office/forum/…
– Antony
Sep 14 '15 at 11:34
|
show 2 more comments
Whenever I put a dot character into a custom cell format Excel will interpret it as if I want a decimal separator in that location of the format. The problem being that decimal separator changes with the locale. I actually just want a dot.
Here's an example format that won't work:
hh:mm:ss.000
(it won't work because if the locale uses anything else than a dot as a decimal separator then you'll see something like 22:31:34,854 in your formatted value)
I've tried something like
hh:mm:ss.000
to make Excel understand that I really want a dot. However Excel 2010 refuses to accept that as a valid format. (I've read somewhere that the is the way to escape a character in an Excel format string)
UPDATE (AND A KIND OF ANSWER)
The official documentation from Microsoft says that you can get a format to print a character that would otherwise be interpreted as a meta-character by placing the character in double quotation marks or by escaping it with a backslash. For example the following format #.##0. will format 1234 as 1.234. on a US locale. Although the example is nonsense this proves that escaping the period character actually works.
So why won't it work when creating a timestamp format with milliseconds ?
The answer lies in the way that Microsoft designed the format specifiers. Those meta characters (like 0 (zero)) have different interpretation depending on their surroundings. In some context 0 means to always have a digit in that location. So placing three zeros in a format, as in #0.000, means to format 12 as 12.000. However when the three zeroes are placed after a time format they are interpreted as meaning "milliseconds". If we escape the period just before the three zeroes then the three zeroes are no longer "near" the time format specifiers and Excel gets confused and can no longer determine if we mean "milliseconds" or digit placeholder. Hence it has no option than to refuse the format. At least this is my interpretation of why it doesn't work.
This ambiguity in the format meta chars is really the root of all evil. If you compare to various programming languages I've never before seen that format string meta chars can have different interpretation depending on context. In this case it means that there's no way that Excel can create a time format will milliseconds the way it supposed to look. You'll simply have to accept that the period char may mysteriously change to , sometimes (depending on the user's locale settings).
microsoft-excel microsoft-excel-2010
Whenever I put a dot character into a custom cell format Excel will interpret it as if I want a decimal separator in that location of the format. The problem being that decimal separator changes with the locale. I actually just want a dot.
Here's an example format that won't work:
hh:mm:ss.000
(it won't work because if the locale uses anything else than a dot as a decimal separator then you'll see something like 22:31:34,854 in your formatted value)
I've tried something like
hh:mm:ss.000
to make Excel understand that I really want a dot. However Excel 2010 refuses to accept that as a valid format. (I've read somewhere that the is the way to escape a character in an Excel format string)
UPDATE (AND A KIND OF ANSWER)
The official documentation from Microsoft says that you can get a format to print a character that would otherwise be interpreted as a meta-character by placing the character in double quotation marks or by escaping it with a backslash. For example the following format #.##0. will format 1234 as 1.234. on a US locale. Although the example is nonsense this proves that escaping the period character actually works.
So why won't it work when creating a timestamp format with milliseconds ?
The answer lies in the way that Microsoft designed the format specifiers. Those meta characters (like 0 (zero)) have different interpretation depending on their surroundings. In some context 0 means to always have a digit in that location. So placing three zeros in a format, as in #0.000, means to format 12 as 12.000. However when the three zeroes are placed after a time format they are interpreted as meaning "milliseconds". If we escape the period just before the three zeroes then the three zeroes are no longer "near" the time format specifiers and Excel gets confused and can no longer determine if we mean "milliseconds" or digit placeholder. Hence it has no option than to refuse the format. At least this is my interpretation of why it doesn't work.
This ambiguity in the format meta chars is really the root of all evil. If you compare to various programming languages I've never before seen that format string meta chars can have different interpretation depending on context. In this case it means that there's no way that Excel can create a time format will milliseconds the way it supposed to look. You'll simply have to accept that the period char may mysteriously change to , sometimes (depending on the user's locale settings).
microsoft-excel microsoft-excel-2010
microsoft-excel microsoft-excel-2010
edited Aug 26 '15 at 20:17
peterh
asked Aug 24 '15 at 18:30
peterhpeterh
13616
13616
2
What exactly do you want to accomplish as end result?
– LPChip
Aug 24 '15 at 18:38
I hope that was obvious: I want to format a time value with milliseconds. The problem I have is that Excel will interpret the.in the format string as meaning decimal separator rather than simply just printing a dot.
– peterh
Aug 24 '15 at 20:12
I am able to use hh:mm:ss.000 format just fine on a cell for time what version of excel are you using?
– Matthew Lozoya
Aug 25 '15 at 5:25
It's not about being able to use thehh:mm:ss.000format, it's about being sure that the dot is really a dot. I bet you didn't test on a locale where your decimal separator is say a comma ?? If so you would notice that Excel would print your formatted timeval as something like06:33:55,872and that is not what I want. I just want a dot (literally). As indicated in the question I'm using Excel 2010.
– peterh
Aug 25 '15 at 14:58
answers.microsoft.com/en-us/office/forum/…
– Antony
Sep 14 '15 at 11:34
|
show 2 more comments
2
What exactly do you want to accomplish as end result?
– LPChip
Aug 24 '15 at 18:38
I hope that was obvious: I want to format a time value with milliseconds. The problem I have is that Excel will interpret the.in the format string as meaning decimal separator rather than simply just printing a dot.
– peterh
Aug 24 '15 at 20:12
I am able to use hh:mm:ss.000 format just fine on a cell for time what version of excel are you using?
– Matthew Lozoya
Aug 25 '15 at 5:25
It's not about being able to use thehh:mm:ss.000format, it's about being sure that the dot is really a dot. I bet you didn't test on a locale where your decimal separator is say a comma ?? If so you would notice that Excel would print your formatted timeval as something like06:33:55,872and that is not what I want. I just want a dot (literally). As indicated in the question I'm using Excel 2010.
– peterh
Aug 25 '15 at 14:58
answers.microsoft.com/en-us/office/forum/…
– Antony
Sep 14 '15 at 11:34
2
2
What exactly do you want to accomplish as end result?
– LPChip
Aug 24 '15 at 18:38
What exactly do you want to accomplish as end result?
– LPChip
Aug 24 '15 at 18:38
I hope that was obvious: I want to format a time value with milliseconds. The problem I have is that Excel will interpret the
. in the format string as meaning decimal separator rather than simply just printing a dot.– peterh
Aug 24 '15 at 20:12
I hope that was obvious: I want to format a time value with milliseconds. The problem I have is that Excel will interpret the
. in the format string as meaning decimal separator rather than simply just printing a dot.– peterh
Aug 24 '15 at 20:12
I am able to use hh:mm:ss.000 format just fine on a cell for time what version of excel are you using?
– Matthew Lozoya
Aug 25 '15 at 5:25
I am able to use hh:mm:ss.000 format just fine on a cell for time what version of excel are you using?
– Matthew Lozoya
Aug 25 '15 at 5:25
It's not about being able to use the
hh:mm:ss.000 format, it's about being sure that the dot is really a dot. I bet you didn't test on a locale where your decimal separator is say a comma ?? If so you would notice that Excel would print your formatted timeval as something like 06:33:55,872 and that is not what I want. I just want a dot (literally). As indicated in the question I'm using Excel 2010.– peterh
Aug 25 '15 at 14:58
It's not about being able to use the
hh:mm:ss.000 format, it's about being sure that the dot is really a dot. I bet you didn't test on a locale where your decimal separator is say a comma ?? If so you would notice that Excel would print your formatted timeval as something like 06:33:55,872 and that is not what I want. I just want a dot (literally). As indicated in the question I'm using Excel 2010.– peterh
Aug 25 '15 at 14:58
answers.microsoft.com/en-us/office/forum/…
– Antony
Sep 14 '15 at 11:34
answers.microsoft.com/en-us/office/forum/…
– Antony
Sep 14 '15 at 11:34
|
show 2 more comments
1 Answer
1
active
oldest
votes
I'm afraid you have to use the "Text" cell format and use a formula that will output a text value with the required separators
=LEFT(A1;2) & ":" & MID(A1;4;2) & ":" & MID(A1;7;2) & "." & RIGHT(A1;3)
Excel doesn't handle milliseconds in named formats...
Sure, I can always do text tricks but that will mean that the content of the cell will no longer be a numeric and hence no longer an Excel time value.
– peterh
Aug 26 '15 at 20:21
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f962148%2fexcel-how-to-put-a-literal-dot-into-a-cell-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I'm afraid you have to use the "Text" cell format and use a formula that will output a text value with the required separators
=LEFT(A1;2) & ":" & MID(A1;4;2) & ":" & MID(A1;7;2) & "." & RIGHT(A1;3)
Excel doesn't handle milliseconds in named formats...
Sure, I can always do text tricks but that will mean that the content of the cell will no longer be a numeric and hence no longer an Excel time value.
– peterh
Aug 26 '15 at 20:21
add a comment |
I'm afraid you have to use the "Text" cell format and use a formula that will output a text value with the required separators
=LEFT(A1;2) & ":" & MID(A1;4;2) & ":" & MID(A1;7;2) & "." & RIGHT(A1;3)
Excel doesn't handle milliseconds in named formats...
Sure, I can always do text tricks but that will mean that the content of the cell will no longer be a numeric and hence no longer an Excel time value.
– peterh
Aug 26 '15 at 20:21
add a comment |
I'm afraid you have to use the "Text" cell format and use a formula that will output a text value with the required separators
=LEFT(A1;2) & ":" & MID(A1;4;2) & ":" & MID(A1;7;2) & "." & RIGHT(A1;3)
Excel doesn't handle milliseconds in named formats...
I'm afraid you have to use the "Text" cell format and use a formula that will output a text value with the required separators
=LEFT(A1;2) & ":" & MID(A1;4;2) & ":" & MID(A1;7;2) & "." & RIGHT(A1;3)
Excel doesn't handle milliseconds in named formats...
answered Aug 26 '15 at 11:23
user2955677user2955677
362
362
Sure, I can always do text tricks but that will mean that the content of the cell will no longer be a numeric and hence no longer an Excel time value.
– peterh
Aug 26 '15 at 20:21
add a comment |
Sure, I can always do text tricks but that will mean that the content of the cell will no longer be a numeric and hence no longer an Excel time value.
– peterh
Aug 26 '15 at 20:21
Sure, I can always do text tricks but that will mean that the content of the cell will no longer be a numeric and hence no longer an Excel time value.
– peterh
Aug 26 '15 at 20:21
Sure, I can always do text tricks but that will mean that the content of the cell will no longer be a numeric and hence no longer an Excel time value.
– peterh
Aug 26 '15 at 20:21
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f962148%2fexcel-how-to-put-a-literal-dot-into-a-cell-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
What exactly do you want to accomplish as end result?
– LPChip
Aug 24 '15 at 18:38
I hope that was obvious: I want to format a time value with milliseconds. The problem I have is that Excel will interpret the
.in the format string as meaning decimal separator rather than simply just printing a dot.– peterh
Aug 24 '15 at 20:12
I am able to use hh:mm:ss.000 format just fine on a cell for time what version of excel are you using?
– Matthew Lozoya
Aug 25 '15 at 5:25
It's not about being able to use the
hh:mm:ss.000format, it's about being sure that the dot is really a dot. I bet you didn't test on a locale where your decimal separator is say a comma ?? If so you would notice that Excel would print your formatted timeval as something like06:33:55,872and that is not what I want. I just want a dot (literally). As indicated in the question I'm using Excel 2010.– peterh
Aug 25 '15 at 14:58
answers.microsoft.com/en-us/office/forum/…
– Antony
Sep 14 '15 at 11:34