Excel adds quotation marks to the end of my formula












2















Excel automatically corrects my formula, saying "We found a typo in your formula and tried to correct it to:"



=CONCAT(CHAR(34),A4,""":""",D4,"""")


My original formula only has three quotation marks at the end:



=CONCAT(CHAR(34),A4,""":""",D4,""")


For your info I combine the data from two columns in Excel and the result shall look like this:



"welcome":"Bienvenue!"


The A4 cell contains: welcome

The D4 cell contains: Bienvenue!



CHAR(34) represents the initial quotation mark for cell A4.



The Excel CONCAT() function combines the data from different Ms Excel cells.



Note: This question is not similar to the Superuser question Excel adds quotation marks to the result of my formula










share|improve this question









New contributor




Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 2





    Hey Gabriel, welcome to Superuser. You already posted an out to your problem yourself. Instead of using """. You can just use: ,CHAR(34) which gives a double quotation mark. You will have to use more commas, but this is the easiest solution I see.

    – Michthan
    yesterday











  • @Michthan or just follow the Excel delimiter rules -- see my answer.

    – Carl Witthoft
    yesterday






  • 1





    Excel is correcting your incorrect formula. You should be happy about this. """ is not a valid string, while """" is ok

    – edc65
    yesterday
















2















Excel automatically corrects my formula, saying "We found a typo in your formula and tried to correct it to:"



=CONCAT(CHAR(34),A4,""":""",D4,"""")


My original formula only has three quotation marks at the end:



=CONCAT(CHAR(34),A4,""":""",D4,""")


For your info I combine the data from two columns in Excel and the result shall look like this:



"welcome":"Bienvenue!"


The A4 cell contains: welcome

The D4 cell contains: Bienvenue!



CHAR(34) represents the initial quotation mark for cell A4.



The Excel CONCAT() function combines the data from different Ms Excel cells.



Note: This question is not similar to the Superuser question Excel adds quotation marks to the result of my formula










share|improve this question









New contributor




Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 2





    Hey Gabriel, welcome to Superuser. You already posted an out to your problem yourself. Instead of using """. You can just use: ,CHAR(34) which gives a double quotation mark. You will have to use more commas, but this is the easiest solution I see.

    – Michthan
    yesterday











  • @Michthan or just follow the Excel delimiter rules -- see my answer.

    – Carl Witthoft
    yesterday






  • 1





    Excel is correcting your incorrect formula. You should be happy about this. """ is not a valid string, while """" is ok

    – edc65
    yesterday














2












2








2


1






Excel automatically corrects my formula, saying "We found a typo in your formula and tried to correct it to:"



=CONCAT(CHAR(34),A4,""":""",D4,"""")


My original formula only has three quotation marks at the end:



=CONCAT(CHAR(34),A4,""":""",D4,""")


For your info I combine the data from two columns in Excel and the result shall look like this:



"welcome":"Bienvenue!"


The A4 cell contains: welcome

The D4 cell contains: Bienvenue!



CHAR(34) represents the initial quotation mark for cell A4.



The Excel CONCAT() function combines the data from different Ms Excel cells.



Note: This question is not similar to the Superuser question Excel adds quotation marks to the result of my formula










share|improve this question









New contributor




Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












Excel automatically corrects my formula, saying "We found a typo in your formula and tried to correct it to:"



=CONCAT(CHAR(34),A4,""":""",D4,"""")


My original formula only has three quotation marks at the end:



=CONCAT(CHAR(34),A4,""":""",D4,""")


For your info I combine the data from two columns in Excel and the result shall look like this:



"welcome":"Bienvenue!"


The A4 cell contains: welcome

The D4 cell contains: Bienvenue!



CHAR(34) represents the initial quotation mark for cell A4.



The Excel CONCAT() function combines the data from different Ms Excel cells.



Note: This question is not similar to the Superuser question Excel adds quotation marks to the result of my formula







microsoft-excel microsoft-excel-2016 special-characters concatenation escape-characters






share|improve this question









New contributor




Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday









fixer1234

18.6k144782




18.6k144782






New contributor




Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









GabrielGabriel

113




113




New contributor




Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Gabriel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 2





    Hey Gabriel, welcome to Superuser. You already posted an out to your problem yourself. Instead of using """. You can just use: ,CHAR(34) which gives a double quotation mark. You will have to use more commas, but this is the easiest solution I see.

    – Michthan
    yesterday











  • @Michthan or just follow the Excel delimiter rules -- see my answer.

    – Carl Witthoft
    yesterday






  • 1





    Excel is correcting your incorrect formula. You should be happy about this. """ is not a valid string, while """" is ok

    – edc65
    yesterday














  • 2





    Hey Gabriel, welcome to Superuser. You already posted an out to your problem yourself. Instead of using """. You can just use: ,CHAR(34) which gives a double quotation mark. You will have to use more commas, but this is the easiest solution I see.

    – Michthan
    yesterday











  • @Michthan or just follow the Excel delimiter rules -- see my answer.

    – Carl Witthoft
    yesterday






  • 1





    Excel is correcting your incorrect formula. You should be happy about this. """ is not a valid string, while """" is ok

    – edc65
    yesterday








2




2





Hey Gabriel, welcome to Superuser. You already posted an out to your problem yourself. Instead of using """. You can just use: ,CHAR(34) which gives a double quotation mark. You will have to use more commas, but this is the easiest solution I see.

– Michthan
yesterday





Hey Gabriel, welcome to Superuser. You already posted an out to your problem yourself. Instead of using """. You can just use: ,CHAR(34) which gives a double quotation mark. You will have to use more commas, but this is the easiest solution I see.

– Michthan
yesterday













@Michthan or just follow the Excel delimiter rules -- see my answer.

– Carl Witthoft
yesterday





@Michthan or just follow the Excel delimiter rules -- see my answer.

– Carl Witthoft
yesterday




1




1





Excel is correcting your incorrect formula. You should be happy about this. """ is not a valid string, while """" is ok

– edc65
yesterday





Excel is correcting your incorrect formula. You should be happy about this. """ is not a valid string, while """" is ok

– edc65
yesterday










3 Answers
3






active

oldest

votes


















14














Quotation marks have a special meaning in Excel, so you have to jump through some hoops to use them as a regular character. You can do that by doubling them, but that can get complicated, depending on the situation.



To avoid terminology confusion, lets ignore apostrophes (sometimes called "single quotes"). Any reference here to "quote" or "quotation mark" refers to the symbol with two tick marks.



The rules are understandable if you recognize what's going on.




  • Quotation marks always need to be in pairs (but not necessarily adjacent).

  • A doubled quote becomes a single text character (a quotation mark).

  • Text needs to be in quotes.

  • If the doubled quote is in the middle of a string, it is just another character.

  • If it is at the beginning or end of a string, the string of which it is a part must be enclosed in quotes (so you will end up with triple quotes at the beginning or end).

  • If it is concatenated as the only character (at the beginning, middle, or end of an expression), it needs to be enclosed in quotes (so you end up with quadruple quotes).


Here are some examples using your formula:



enter image description here




  • You can see that you got it right using triple quotes around the colon. Think of that as the colon surrounded by doubled quotes, and all of that inside quotes to delimit that text.

  • You got it right again with CHAR(34) to start the string. You can do the same for the last character.

  • Since the first and last characters are concatenated, you could alternatively quadruple those (like D4&""""). That's what Excel tried to fix for you.

  • If the expression had started or ended with hard-coded text instead of a cell reference, you could use tripled quotes (like """Welcome")


So this can be done using multiple quotes, although you can go cross-eyed if you need to diagnose formula problems if you mess up. The simple, safe way to do it is to use CHAR(34), especially when quadruple quotes are needed, as Hannu's answer suggests (although my own preference would be to keep the triple quotes around the colon to avoid splitting one text expression into three pieces; but that's why there's both vanilla and chocolate ice cream).






share|improve this answer


























  • I prefer Heath Bar Crunch myself

    – Carl Witthoft
    yesterday











  • Shouldn't be hard to not get cross-eyed - the two easiest ways to tell whether it's a closing quote or a literal quote are 1. Read the opening quote. Then, while the next quotes come in pairs, they are literal quotes. If not, it's a closing quote. Alternatively, you can split them into essentially smaller strings - """:""" becomes "" ":" "". Then, just join all the strings together with quotes

    – somebody
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =""""&A4&""":"""&D4&"""," I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago











  • @Gabriel, did you try it to see what you get? :-) That looks right, although in your desired output in your comment it looks like there's a space after the colon, which you would need to include if that's right: . . . (""": """ vs. """:"""). It's personal preference whether to use CONCAT with commas vs. ampersands; same with """" vs. CHAR(34) for a single concatenated quote. So the version of the formula in your comment on Hannu's answer will also work (same point with the apparent space after the colon: ": " vs. ":").

    – fixer1234
    13 hours ago





















4














These two are equivlent, and both create the expected string:



=CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34))



Note that , inside function calls as this may need to be changed to ; depending on your locale.



=CHAR(34) &A4 &CHAR(34) &":" &CHAR(34) &D4 &CHAR(34)



You can include doublequotes in a string of chars as there is "eascaping" available, but combined with the fact that strings start and end with a doublequote it quickly becomes ugly and hard to maintain; e.g. ="""welcome"":""Bienvenue!""" - you need more quotes to add the cell references above; =""""&A4&""":"""&D4&"""" ... easy to get wrong.



NOTE: updated w.r.t. quote escaping.






share|improve this answer


























  • Nothing wrong with 4 doublequotes in a row other than it looks ugly

    – Carl Witthoft
    yesterday






  • 1





    @CarlWitthoft, unless you need to diagnose a typing error in a long formula full of triple and quadruple double quotes. That's one of two things that can make you go blind. :-)

    – fixer1234
    yesterday











  • @fixer1234 True that -- or 7-deep parentheses

    – Carl Witthoft
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34),",",) I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago













  • Really, the choice is yours, I have hard to believe the choices makes much difference speed-wise, at least not when using moderate amounts of data. There might be a difference if you have huge data amounts though. I'd go for good readbility - so that any later review (after a year or so maybe) would be easier; e.g. if attempting changes.

    – Hannu
    9 hours ago





















1














I'm not sure what the confusion is here: perhaps you were trying to enclose all the arguments to CONCAT with doublequotes? You are concatenating several strings, and each one must meet Excel's rules. Each string must then be delimited with a double-quote at each end. Thus, for any string whatsoever, you must write



"the_string" 


If your string contains a doublequote, that double quote has to be "escaped" by repeating it,



"the""string"   


So, in each instance of a string in your concatenation, follow that rule. Think of your first and last strings as



$DELIMITER""$DELIMITER


Because the value of $DELIMITER happens to be the doublequote, it looks ugly but does follow the rules.






share|improve this answer
























  • Carl great answer, this makes perfect sense to me!

    – Michthan
    15 hours ago











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
});


}
});






Gabriel is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400438%2fexcel-adds-quotation-marks-to-the-end-of-my-formula%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









14














Quotation marks have a special meaning in Excel, so you have to jump through some hoops to use them as a regular character. You can do that by doubling them, but that can get complicated, depending on the situation.



To avoid terminology confusion, lets ignore apostrophes (sometimes called "single quotes"). Any reference here to "quote" or "quotation mark" refers to the symbol with two tick marks.



The rules are understandable if you recognize what's going on.




  • Quotation marks always need to be in pairs (but not necessarily adjacent).

  • A doubled quote becomes a single text character (a quotation mark).

  • Text needs to be in quotes.

  • If the doubled quote is in the middle of a string, it is just another character.

  • If it is at the beginning or end of a string, the string of which it is a part must be enclosed in quotes (so you will end up with triple quotes at the beginning or end).

  • If it is concatenated as the only character (at the beginning, middle, or end of an expression), it needs to be enclosed in quotes (so you end up with quadruple quotes).


Here are some examples using your formula:



enter image description here




  • You can see that you got it right using triple quotes around the colon. Think of that as the colon surrounded by doubled quotes, and all of that inside quotes to delimit that text.

  • You got it right again with CHAR(34) to start the string. You can do the same for the last character.

  • Since the first and last characters are concatenated, you could alternatively quadruple those (like D4&""""). That's what Excel tried to fix for you.

  • If the expression had started or ended with hard-coded text instead of a cell reference, you could use tripled quotes (like """Welcome")


So this can be done using multiple quotes, although you can go cross-eyed if you need to diagnose formula problems if you mess up. The simple, safe way to do it is to use CHAR(34), especially when quadruple quotes are needed, as Hannu's answer suggests (although my own preference would be to keep the triple quotes around the colon to avoid splitting one text expression into three pieces; but that's why there's both vanilla and chocolate ice cream).






share|improve this answer


























  • I prefer Heath Bar Crunch myself

    – Carl Witthoft
    yesterday











  • Shouldn't be hard to not get cross-eyed - the two easiest ways to tell whether it's a closing quote or a literal quote are 1. Read the opening quote. Then, while the next quotes come in pairs, they are literal quotes. If not, it's a closing quote. Alternatively, you can split them into essentially smaller strings - """:""" becomes "" ":" "". Then, just join all the strings together with quotes

    – somebody
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =""""&A4&""":"""&D4&"""," I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago











  • @Gabriel, did you try it to see what you get? :-) That looks right, although in your desired output in your comment it looks like there's a space after the colon, which you would need to include if that's right: . . . (""": """ vs. """:"""). It's personal preference whether to use CONCAT with commas vs. ampersands; same with """" vs. CHAR(34) for a single concatenated quote. So the version of the formula in your comment on Hannu's answer will also work (same point with the apparent space after the colon: ": " vs. ":").

    – fixer1234
    13 hours ago


















14














Quotation marks have a special meaning in Excel, so you have to jump through some hoops to use them as a regular character. You can do that by doubling them, but that can get complicated, depending on the situation.



To avoid terminology confusion, lets ignore apostrophes (sometimes called "single quotes"). Any reference here to "quote" or "quotation mark" refers to the symbol with two tick marks.



The rules are understandable if you recognize what's going on.




  • Quotation marks always need to be in pairs (but not necessarily adjacent).

  • A doubled quote becomes a single text character (a quotation mark).

  • Text needs to be in quotes.

  • If the doubled quote is in the middle of a string, it is just another character.

  • If it is at the beginning or end of a string, the string of which it is a part must be enclosed in quotes (so you will end up with triple quotes at the beginning or end).

  • If it is concatenated as the only character (at the beginning, middle, or end of an expression), it needs to be enclosed in quotes (so you end up with quadruple quotes).


Here are some examples using your formula:



enter image description here




  • You can see that you got it right using triple quotes around the colon. Think of that as the colon surrounded by doubled quotes, and all of that inside quotes to delimit that text.

  • You got it right again with CHAR(34) to start the string. You can do the same for the last character.

  • Since the first and last characters are concatenated, you could alternatively quadruple those (like D4&""""). That's what Excel tried to fix for you.

  • If the expression had started or ended with hard-coded text instead of a cell reference, you could use tripled quotes (like """Welcome")


So this can be done using multiple quotes, although you can go cross-eyed if you need to diagnose formula problems if you mess up. The simple, safe way to do it is to use CHAR(34), especially when quadruple quotes are needed, as Hannu's answer suggests (although my own preference would be to keep the triple quotes around the colon to avoid splitting one text expression into three pieces; but that's why there's both vanilla and chocolate ice cream).






share|improve this answer


























  • I prefer Heath Bar Crunch myself

    – Carl Witthoft
    yesterday











  • Shouldn't be hard to not get cross-eyed - the two easiest ways to tell whether it's a closing quote or a literal quote are 1. Read the opening quote. Then, while the next quotes come in pairs, they are literal quotes. If not, it's a closing quote. Alternatively, you can split them into essentially smaller strings - """:""" becomes "" ":" "". Then, just join all the strings together with quotes

    – somebody
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =""""&A4&""":"""&D4&"""," I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago











  • @Gabriel, did you try it to see what you get? :-) That looks right, although in your desired output in your comment it looks like there's a space after the colon, which you would need to include if that's right: . . . (""": """ vs. """:"""). It's personal preference whether to use CONCAT with commas vs. ampersands; same with """" vs. CHAR(34) for a single concatenated quote. So the version of the formula in your comment on Hannu's answer will also work (same point with the apparent space after the colon: ": " vs. ":").

    – fixer1234
    13 hours ago
















14












14








14







Quotation marks have a special meaning in Excel, so you have to jump through some hoops to use them as a regular character. You can do that by doubling them, but that can get complicated, depending on the situation.



To avoid terminology confusion, lets ignore apostrophes (sometimes called "single quotes"). Any reference here to "quote" or "quotation mark" refers to the symbol with two tick marks.



The rules are understandable if you recognize what's going on.




  • Quotation marks always need to be in pairs (but not necessarily adjacent).

  • A doubled quote becomes a single text character (a quotation mark).

  • Text needs to be in quotes.

  • If the doubled quote is in the middle of a string, it is just another character.

  • If it is at the beginning or end of a string, the string of which it is a part must be enclosed in quotes (so you will end up with triple quotes at the beginning or end).

  • If it is concatenated as the only character (at the beginning, middle, or end of an expression), it needs to be enclosed in quotes (so you end up with quadruple quotes).


Here are some examples using your formula:



enter image description here




  • You can see that you got it right using triple quotes around the colon. Think of that as the colon surrounded by doubled quotes, and all of that inside quotes to delimit that text.

  • You got it right again with CHAR(34) to start the string. You can do the same for the last character.

  • Since the first and last characters are concatenated, you could alternatively quadruple those (like D4&""""). That's what Excel tried to fix for you.

  • If the expression had started or ended with hard-coded text instead of a cell reference, you could use tripled quotes (like """Welcome")


So this can be done using multiple quotes, although you can go cross-eyed if you need to diagnose formula problems if you mess up. The simple, safe way to do it is to use CHAR(34), especially when quadruple quotes are needed, as Hannu's answer suggests (although my own preference would be to keep the triple quotes around the colon to avoid splitting one text expression into three pieces; but that's why there's both vanilla and chocolate ice cream).






share|improve this answer















Quotation marks have a special meaning in Excel, so you have to jump through some hoops to use them as a regular character. You can do that by doubling them, but that can get complicated, depending on the situation.



To avoid terminology confusion, lets ignore apostrophes (sometimes called "single quotes"). Any reference here to "quote" or "quotation mark" refers to the symbol with two tick marks.



The rules are understandable if you recognize what's going on.




  • Quotation marks always need to be in pairs (but not necessarily adjacent).

  • A doubled quote becomes a single text character (a quotation mark).

  • Text needs to be in quotes.

  • If the doubled quote is in the middle of a string, it is just another character.

  • If it is at the beginning or end of a string, the string of which it is a part must be enclosed in quotes (so you will end up with triple quotes at the beginning or end).

  • If it is concatenated as the only character (at the beginning, middle, or end of an expression), it needs to be enclosed in quotes (so you end up with quadruple quotes).


Here are some examples using your formula:



enter image description here




  • You can see that you got it right using triple quotes around the colon. Think of that as the colon surrounded by doubled quotes, and all of that inside quotes to delimit that text.

  • You got it right again with CHAR(34) to start the string. You can do the same for the last character.

  • Since the first and last characters are concatenated, you could alternatively quadruple those (like D4&""""). That's what Excel tried to fix for you.

  • If the expression had started or ended with hard-coded text instead of a cell reference, you could use tripled quotes (like """Welcome")


So this can be done using multiple quotes, although you can go cross-eyed if you need to diagnose formula problems if you mess up. The simple, safe way to do it is to use CHAR(34), especially when quadruple quotes are needed, as Hannu's answer suggests (although my own preference would be to keep the triple quotes around the colon to avoid splitting one text expression into three pieces; but that's why there's both vanilla and chocolate ice cream).







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered yesterday









fixer1234fixer1234

18.6k144782




18.6k144782













  • I prefer Heath Bar Crunch myself

    – Carl Witthoft
    yesterday











  • Shouldn't be hard to not get cross-eyed - the two easiest ways to tell whether it's a closing quote or a literal quote are 1. Read the opening quote. Then, while the next quotes come in pairs, they are literal quotes. If not, it's a closing quote. Alternatively, you can split them into essentially smaller strings - """:""" becomes "" ":" "". Then, just join all the strings together with quotes

    – somebody
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =""""&A4&""":"""&D4&"""," I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago











  • @Gabriel, did you try it to see what you get? :-) That looks right, although in your desired output in your comment it looks like there's a space after the colon, which you would need to include if that's right: . . . (""": """ vs. """:"""). It's personal preference whether to use CONCAT with commas vs. ampersands; same with """" vs. CHAR(34) for a single concatenated quote. So the version of the formula in your comment on Hannu's answer will also work (same point with the apparent space after the colon: ": " vs. ":").

    – fixer1234
    13 hours ago





















  • I prefer Heath Bar Crunch myself

    – Carl Witthoft
    yesterday











  • Shouldn't be hard to not get cross-eyed - the two easiest ways to tell whether it's a closing quote or a literal quote are 1. Read the opening quote. Then, while the next quotes come in pairs, they are literal quotes. If not, it's a closing quote. Alternatively, you can split them into essentially smaller strings - """:""" becomes "" ":" "". Then, just join all the strings together with quotes

    – somebody
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =""""&A4&""":"""&D4&"""," I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago











  • @Gabriel, did you try it to see what you get? :-) That looks right, although in your desired output in your comment it looks like there's a space after the colon, which you would need to include if that's right: . . . (""": """ vs. """:"""). It's personal preference whether to use CONCAT with commas vs. ampersands; same with """" vs. CHAR(34) for a single concatenated quote. So the version of the formula in your comment on Hannu's answer will also work (same point with the apparent space after the colon: ": " vs. ":").

    – fixer1234
    13 hours ago



















I prefer Heath Bar Crunch myself

– Carl Witthoft
yesterday





I prefer Heath Bar Crunch myself

– Carl Witthoft
yesterday













Shouldn't be hard to not get cross-eyed - the two easiest ways to tell whether it's a closing quote or a literal quote are 1. Read the opening quote. Then, while the next quotes come in pairs, they are literal quotes. If not, it's a closing quote. Alternatively, you can split them into essentially smaller strings - """:""" becomes "" ":" "". Then, just join all the strings together with quotes

– somebody
yesterday





Shouldn't be hard to not get cross-eyed - the two easiest ways to tell whether it's a closing quote or a literal quote are 1. Read the opening quote. Then, while the next quotes come in pairs, they are literal quotes. If not, it's a closing quote. Alternatively, you can split them into essentially smaller strings - """:""" becomes "" ":" "". Then, just join all the strings together with quotes

– somebody
yesterday













My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =""""&A4&""":"""&D4&"""," I want the result to look like this: "welcome": "Bienvenue!",

– Gabriel
16 hours ago





My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =""""&A4&""":"""&D4&"""," I want the result to look like this: "welcome": "Bienvenue!",

– Gabriel
16 hours ago













@Gabriel, did you try it to see what you get? :-) That looks right, although in your desired output in your comment it looks like there's a space after the colon, which you would need to include if that's right: . . . (""": """ vs. """:"""). It's personal preference whether to use CONCAT with commas vs. ampersands; same with """" vs. CHAR(34) for a single concatenated quote. So the version of the formula in your comment on Hannu's answer will also work (same point with the apparent space after the colon: ": " vs. ":").

– fixer1234
13 hours ago







@Gabriel, did you try it to see what you get? :-) That looks right, although in your desired output in your comment it looks like there's a space after the colon, which you would need to include if that's right: . . . (""": """ vs. """:"""). It's personal preference whether to use CONCAT with commas vs. ampersands; same with """" vs. CHAR(34) for a single concatenated quote. So the version of the formula in your comment on Hannu's answer will also work (same point with the apparent space after the colon: ": " vs. ":").

– fixer1234
13 hours ago















4














These two are equivlent, and both create the expected string:



=CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34))



Note that , inside function calls as this may need to be changed to ; depending on your locale.



=CHAR(34) &A4 &CHAR(34) &":" &CHAR(34) &D4 &CHAR(34)



You can include doublequotes in a string of chars as there is "eascaping" available, but combined with the fact that strings start and end with a doublequote it quickly becomes ugly and hard to maintain; e.g. ="""welcome"":""Bienvenue!""" - you need more quotes to add the cell references above; =""""&A4&""":"""&D4&"""" ... easy to get wrong.



NOTE: updated w.r.t. quote escaping.






share|improve this answer


























  • Nothing wrong with 4 doublequotes in a row other than it looks ugly

    – Carl Witthoft
    yesterday






  • 1





    @CarlWitthoft, unless you need to diagnose a typing error in a long formula full of triple and quadruple double quotes. That's one of two things that can make you go blind. :-)

    – fixer1234
    yesterday











  • @fixer1234 True that -- or 7-deep parentheses

    – Carl Witthoft
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34),",",) I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago













  • Really, the choice is yours, I have hard to believe the choices makes much difference speed-wise, at least not when using moderate amounts of data. There might be a difference if you have huge data amounts though. I'd go for good readbility - so that any later review (after a year or so maybe) would be easier; e.g. if attempting changes.

    – Hannu
    9 hours ago


















4














These two are equivlent, and both create the expected string:



=CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34))



Note that , inside function calls as this may need to be changed to ; depending on your locale.



=CHAR(34) &A4 &CHAR(34) &":" &CHAR(34) &D4 &CHAR(34)



You can include doublequotes in a string of chars as there is "eascaping" available, but combined with the fact that strings start and end with a doublequote it quickly becomes ugly and hard to maintain; e.g. ="""welcome"":""Bienvenue!""" - you need more quotes to add the cell references above; =""""&A4&""":"""&D4&"""" ... easy to get wrong.



NOTE: updated w.r.t. quote escaping.






share|improve this answer


























  • Nothing wrong with 4 doublequotes in a row other than it looks ugly

    – Carl Witthoft
    yesterday






  • 1





    @CarlWitthoft, unless you need to diagnose a typing error in a long formula full of triple and quadruple double quotes. That's one of two things that can make you go blind. :-)

    – fixer1234
    yesterday











  • @fixer1234 True that -- or 7-deep parentheses

    – Carl Witthoft
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34),",",) I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago













  • Really, the choice is yours, I have hard to believe the choices makes much difference speed-wise, at least not when using moderate amounts of data. There might be a difference if you have huge data amounts though. I'd go for good readbility - so that any later review (after a year or so maybe) would be easier; e.g. if attempting changes.

    – Hannu
    9 hours ago
















4












4








4







These two are equivlent, and both create the expected string:



=CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34))



Note that , inside function calls as this may need to be changed to ; depending on your locale.



=CHAR(34) &A4 &CHAR(34) &":" &CHAR(34) &D4 &CHAR(34)



You can include doublequotes in a string of chars as there is "eascaping" available, but combined with the fact that strings start and end with a doublequote it quickly becomes ugly and hard to maintain; e.g. ="""welcome"":""Bienvenue!""" - you need more quotes to add the cell references above; =""""&A4&""":"""&D4&"""" ... easy to get wrong.



NOTE: updated w.r.t. quote escaping.






share|improve this answer















These two are equivlent, and both create the expected string:



=CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34))



Note that , inside function calls as this may need to be changed to ; depending on your locale.



=CHAR(34) &A4 &CHAR(34) &":" &CHAR(34) &D4 &CHAR(34)



You can include doublequotes in a string of chars as there is "eascaping" available, but combined with the fact that strings start and end with a doublequote it quickly becomes ugly and hard to maintain; e.g. ="""welcome"":""Bienvenue!""" - you need more quotes to add the cell references above; =""""&A4&""":"""&D4&"""" ... easy to get wrong.



NOTE: updated w.r.t. quote escaping.







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered yesterday









HannuHannu

4,1151925




4,1151925













  • Nothing wrong with 4 doublequotes in a row other than it looks ugly

    – Carl Witthoft
    yesterday






  • 1





    @CarlWitthoft, unless you need to diagnose a typing error in a long formula full of triple and quadruple double quotes. That's one of two things that can make you go blind. :-)

    – fixer1234
    yesterday











  • @fixer1234 True that -- or 7-deep parentheses

    – Carl Witthoft
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34),",",) I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago













  • Really, the choice is yours, I have hard to believe the choices makes much difference speed-wise, at least not when using moderate amounts of data. There might be a difference if you have huge data amounts though. I'd go for good readbility - so that any later review (after a year or so maybe) would be easier; e.g. if attempting changes.

    – Hannu
    9 hours ago





















  • Nothing wrong with 4 doublequotes in a row other than it looks ugly

    – Carl Witthoft
    yesterday






  • 1





    @CarlWitthoft, unless you need to diagnose a typing error in a long formula full of triple and quadruple double quotes. That's one of two things that can make you go blind. :-)

    – fixer1234
    yesterday











  • @fixer1234 True that -- or 7-deep parentheses

    – Carl Witthoft
    yesterday











  • My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34),",",) I want the result to look like this: "welcome": "Bienvenue!",

    – Gabriel
    16 hours ago













  • Really, the choice is yours, I have hard to believe the choices makes much difference speed-wise, at least not when using moderate amounts of data. There might be a difference if you have huge data amounts though. I'd go for good readbility - so that any later review (after a year or so maybe) would be easier; e.g. if attempting changes.

    – Hannu
    9 hours ago



















Nothing wrong with 4 doublequotes in a row other than it looks ugly

– Carl Witthoft
yesterday





Nothing wrong with 4 doublequotes in a row other than it looks ugly

– Carl Witthoft
yesterday




1




1





@CarlWitthoft, unless you need to diagnose a typing error in a long formula full of triple and quadruple double quotes. That's one of two things that can make you go blind. :-)

– fixer1234
yesterday





@CarlWitthoft, unless you need to diagnose a typing error in a long formula full of triple and quadruple double quotes. That's one of two things that can make you go blind. :-)

– fixer1234
yesterday













@fixer1234 True that -- or 7-deep parentheses

– Carl Witthoft
yesterday





@fixer1234 True that -- or 7-deep parentheses

– Carl Witthoft
yesterday













My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34),",",) I want the result to look like this: "welcome": "Bienvenue!",

– Gabriel
16 hours ago







My complete formula is actually =CONCAT(CHAR(34),A4,""": """,D4,"""",",") as I'm creating a JSON string in the G column from data in column A and column D. So would you recomend this formula for this? =CONCAT(CHAR(34),A4,CHAR(34),":",CHAR(34),D4,CHAR(34),",",) I want the result to look like this: "welcome": "Bienvenue!",

– Gabriel
16 hours ago















Really, the choice is yours, I have hard to believe the choices makes much difference speed-wise, at least not when using moderate amounts of data. There might be a difference if you have huge data amounts though. I'd go for good readbility - so that any later review (after a year or so maybe) would be easier; e.g. if attempting changes.

– Hannu
9 hours ago







Really, the choice is yours, I have hard to believe the choices makes much difference speed-wise, at least not when using moderate amounts of data. There might be a difference if you have huge data amounts though. I'd go for good readbility - so that any later review (after a year or so maybe) would be easier; e.g. if attempting changes.

– Hannu
9 hours ago













1














I'm not sure what the confusion is here: perhaps you were trying to enclose all the arguments to CONCAT with doublequotes? You are concatenating several strings, and each one must meet Excel's rules. Each string must then be delimited with a double-quote at each end. Thus, for any string whatsoever, you must write



"the_string" 


If your string contains a doublequote, that double quote has to be "escaped" by repeating it,



"the""string"   


So, in each instance of a string in your concatenation, follow that rule. Think of your first and last strings as



$DELIMITER""$DELIMITER


Because the value of $DELIMITER happens to be the doublequote, it looks ugly but does follow the rules.






share|improve this answer
























  • Carl great answer, this makes perfect sense to me!

    – Michthan
    15 hours ago
















1














I'm not sure what the confusion is here: perhaps you were trying to enclose all the arguments to CONCAT with doublequotes? You are concatenating several strings, and each one must meet Excel's rules. Each string must then be delimited with a double-quote at each end. Thus, for any string whatsoever, you must write



"the_string" 


If your string contains a doublequote, that double quote has to be "escaped" by repeating it,



"the""string"   


So, in each instance of a string in your concatenation, follow that rule. Think of your first and last strings as



$DELIMITER""$DELIMITER


Because the value of $DELIMITER happens to be the doublequote, it looks ugly but does follow the rules.






share|improve this answer
























  • Carl great answer, this makes perfect sense to me!

    – Michthan
    15 hours ago














1












1








1







I'm not sure what the confusion is here: perhaps you were trying to enclose all the arguments to CONCAT with doublequotes? You are concatenating several strings, and each one must meet Excel's rules. Each string must then be delimited with a double-quote at each end. Thus, for any string whatsoever, you must write



"the_string" 


If your string contains a doublequote, that double quote has to be "escaped" by repeating it,



"the""string"   


So, in each instance of a string in your concatenation, follow that rule. Think of your first and last strings as



$DELIMITER""$DELIMITER


Because the value of $DELIMITER happens to be the doublequote, it looks ugly but does follow the rules.






share|improve this answer













I'm not sure what the confusion is here: perhaps you were trying to enclose all the arguments to CONCAT with doublequotes? You are concatenating several strings, and each one must meet Excel's rules. Each string must then be delimited with a double-quote at each end. Thus, for any string whatsoever, you must write



"the_string" 


If your string contains a doublequote, that double quote has to be "escaped" by repeating it,



"the""string"   


So, in each instance of a string in your concatenation, follow that rule. Think of your first and last strings as



$DELIMITER""$DELIMITER


Because the value of $DELIMITER happens to be the doublequote, it looks ugly but does follow the rules.







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









Carl WitthoftCarl Witthoft

357314




357314













  • Carl great answer, this makes perfect sense to me!

    – Michthan
    15 hours ago



















  • Carl great answer, this makes perfect sense to me!

    – Michthan
    15 hours ago

















Carl great answer, this makes perfect sense to me!

– Michthan
15 hours ago





Carl great answer, this makes perfect sense to me!

– Michthan
15 hours ago










Gabriel is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Gabriel is a new contributor. Be nice, and check out our Code of Conduct.













Gabriel is a new contributor. Be nice, and check out our Code of Conduct.












Gabriel is a new contributor. Be nice, and check out our Code of Conduct.
















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400438%2fexcel-adds-quotation-marks-to-the-end-of-my-formula%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

RAC Tourist Trophy