#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mg mg is offline
external usenet poster
 
Posts: 35
Default Excel - """"

What is the logic behind ="""" & ="r"

When we need to have "1" in a cell, we need to type = """"&1&""""

Your input will be appreciated
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Excel - """"

If you only want to have

"1"

in a cell, then just type it in that way. No need for a formula (i.e.,
don't start it with a '=').

However, if you want a formula, you need to account for XL using "x" as
an indication that x should be treated as Text. If x is omitted, you get
the null string

""

To differentiate between the quotation marks at the beginning/end of a
string and quotation marks that are part of a string, XL's syntax
requires that the latter be doubled:

"this "" will display a quotation mark within this string"

If the quotation mark is the only text within the string, then it looks
like

""""





In article ,
MG wrote:

What is the logic behind ="""" & ="r"

When we need to have "1" in a cell, we need to type = """"&1&""""

Your input will be appreciated

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Excel - """"

To differentiate between the quotation marks at the beginning/end of a
string and quotation marks that are part of a string, XL's syntax
requires that the latter be doubled:

"this "" will display a quotation mark within this string"

If the quotation mark is the only text within the string, then it looks
like

""""


To add to JE's comment, consider the following....

="AAA""BBB"

which will displays this...

AAA"BBB

Now, remove the 3 A's to get this modified string...

="""BBB"

which displays this...

"BBB

Finally, remove the 3 B's from the modified string to get this...

=""""

which will display the lone quote mark you asked about. As you can see,
there is nothing magical about the 4 quote marks.... it is just what is left
over when you remove all the text from around the double quote marks needed
to display an internal single quote mark,

Rick

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Excel - """"

So to get the literal
"1"
the original poster wanted is possible very simply using ="""1""" rather
than weird concatenation he was using

--
Adam Vero
MCP, MOS Master, MLSS, CWNA
http://veroblog.wordpress.com
http://www.meteorit.co.uk


"Rick Rothstein (MVP - VB)" wrote:

To differentiate between the quotation marks at the beginning/end of a
string and quotation marks that are part of a string, XL's syntax
requires that the latter be doubled:

"this "" will display a quotation mark within this string"

If the quotation mark is the only text within the string, then it looks
like

""""


To add to JE's comment, consider the following....

="AAA""BBB"

which will displays this...

AAA"BBB

Now, remove the 3 A's to get this modified string...

="""BBB"

which displays this...

"BBB

Finally, remove the 3 B's from the modified string to get this...

=""""

which will display the lone quote mark you asked about. As you can see,
there is nothing magical about the 4 quote marks.... it is just what is left
over when you remove all the text from around the double quote marks needed
to display an internal single quote mark,

Rick


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Excel - """"

But why then use a formula at all?

just enter "1"


In article ,
AdamV wrote:

So to get the literal
"1"
the original poster wanted is possible very simply using ="""1""" rather
than weird concatenation he was using

--
Adam Vero
MCP, MOS Master, MLSS, CWNA
http://veroblog.wordpress.com
http://www.meteorit.co.uk



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Excel - """"

So to get the literal
"1"
the original poster wanted is possible very simply using ="""1""" rather
than weird concatenation he was using


Well, that is true if the 1 is hard-coded; but if the "1" were picked up
from a reference in another cell, then the full concatenation would be
required. For example, if A1 contained 1 as its contents, then another cell
displaying it quoted would need to use =""""&A1&"""". The main purpose
behind my post was to give insight as to why four quote marks in a row are
required to display a single quote mark... remember, my post was a follow-up
one to the last part of JE McGimpsey's posting and, by extension, a response
to MG's statement - What is the logic behind =""""? Specifically, that
statement about the four quote marks to display one quote mark is a question
that comes up from time to time over in the newsgroups devoted to the
compiled versions of Visual Basic; so I adapted my stock answer there for my
response here.

Rick

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"