[Solved] How do I enclose a double quotation mark in formula

HowdeeDoodee

Well-known Member
Joined
Nov 15, 2004
Messages
599
Edited several times.

This is what I am referring to as a double quotation mark "

I have two formulas. Formula A finds a single apostrophe and counts the number of occurances in the cell F1. This formula works.

However formula B brings up an error message because I am enclosing a double quotation mark inside double quotation marks. How do I express the quotation mark in formula B and find the number of double quotation marks in cell F1?

A.
=(LEN(F1)-LEN(SUBSTITUTE(F1,"'","")))/LEN("'")

B.
=(LEN(F1)-LEN(SUBSTITUTE(F1, ""","")))/LEN(""")
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Thank you aladin, but when I tried to substitute the chr(34) in the last part of the formula I got this...

=(LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(34),"")))/LENChar(34)

and the formula is generating the #Name? in the cell. Where did I mess up? Thanks again.
 
Upvote 0
OK, I got it to work. I did not enclose the last Chr34 in parens.

=(LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(34),"")))/LEN(CHAR(34))
 
Upvote 0
OK, I got it to work. I did not enclose the last Chr34 in parens.

=(LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(34),"")))/LEN(CHAR(34))

No need for the /LEN(...) bit. That's why I omitted that in both formulas.
 
Upvote 0
OK, now I need to find the number of \" occurences there are in a cell. How do I add the \ in front of the above formula? Thank you again.
 
Upvote 0
OK, here we go. This formula counts the number of times the following character string or text string occurs in a cell. The character string or text string found in this formula equals \"

=(LEN(C1)-LEN(SUBSTITUTE(C1,(("\")&(CHAR(34))),"")))/LEN(("\")&(CHAR(34)))
 
Upvote 0
OK, here we go. This formula counts the number of times the following character string or text string occurs in a cell. The character string or text string found in this formula equals \"

=(LEN(C1)-LEN(SUBSTITUTE(C1,(("\")&(CHAR(34))),"")))/LEN(("\")&(CHAR(34)))

\ is CHAR(92).
 
Upvote 0
Hi,

if have a question:

If you wnat to count the occurances of "" in the cell F1, why is it not enough to take this formula?

<table><tr style="vertical-align:top; text-align:center; "><tr><td>Tabelle3</td></tr><tr><td><table border=1 cellspacing=0 cellpadding=0 style="font-family:Arial,Arial; font-size:10pt; padding-left:2pt; padding-right:2pt; "> <style type = "text/css"> th {font-weight:normal} </style> <colgroup><col width=30 style="font-weight:bold; "><col width=79.999998 ><col width=132.999996675 ></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td> </td><td>E</td><td>F</td></tr><tr height=17 ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="text-align:center; ">5</td><td style="">ewrwe er   we vv</td></tr></table><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#FFFCF9; "><tr><td>Formeln der Tabelle</td></tr><tr><td><table style="font-family:Arial; font-size:10pt;">E1 : =LEN(F1)-LEN(SUBSTITUTE<span style=' color:008000; '>(F1," ","")</span>)
</table></td></tr></table></td></tr><tr><td> </td></tr></tr></table>
 
Upvote 0
Hi,

if have a question:

If you wnat to count the occurances of "" in the cell F1, why is it not enough to take this formula?

...

=LEN(F1)-LEN(SUBSTITUTE<span style=' color:008000; '>(F1," ",""))

...

Are you posing a question or making an observation?
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top