ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   wrap quotes (https://www.excelbanter.com/excel-worksheet-functions/140100-wrap-quotes.html)

Mo2

wrap quotes
 
this is what one line looks like, for example:

Boom 5 bling 4 ding 3

i want to apply a cell format that would make the cells look like this:

"('Boom', '5', 'bling', '4', 'ding', '3')"


as you can see, the first cell has a double quote and a paranthese.
and the last cell has a closing paranthese and a doublequote.

the rest are wrapped in single quotes followed by a comma.

i've figured out the cell format for all the cells, except the first and
last one.
how would I specify the cell format for the first cell and the last cell?
(its not working for me)

oh, and 2nd question:

Sometimes, the cells with TEXT values in willl sometimes have the NUMBER 0
in them (if a condition is false or what not.)

The 0 wont have the same format applied becuz it is a NUMBER in a text
formatted cell.
.. how would i also apply a number cell format? or treat the number as text?

(perhaps a conditional format would help...i just dont know how to write it)

thanks in advance, if you can help with either question



Himani[_2_]

wrap quotes
 
You can use this formula for your first string. Use accordinlgy for last
string.

=CONCATENATE("""","(","'",E7,"'",",")

"Mo2" wrote:

this is what one line looks like, for example:

Boom 5 bling 4 ding 3

i want to apply a cell format that would make the cells look like this:

"('Boom', '5', 'bling', '4', 'ding', '3')"


as you can see, the first cell has a double quote and a paranthese.
and the last cell has a closing paranthese and a doublequote.

the rest are wrapped in single quotes followed by a comma.

i've figured out the cell format for all the cells, except the first and
last one.
how would I specify the cell format for the first cell and the last cell?
(its not working for me)

oh, and 2nd question:

Sometimes, the cells with TEXT values in willl sometimes have the NUMBER 0
in them (if a condition is false or what not.)

The 0 wont have the same format applied becuz it is a NUMBER in a text
formatted cell.
. how would i also apply a number cell format? or treat the number as text?

(perhaps a conditional format would help...i just dont know how to write it)

thanks in advance, if you can help with either question



Mo2

wrap quotes
 
hey
altho your method does work, i used this cell format: \"('@',
it saved me from having to edit every cell (and the cells with formulas
already in them would look more confusing)

BTW, can you help me with the 0 problem?
the columns with text values in them, will sometimes have a "0" in some cells
(based on some conditions)

those columns have a text cell format..so it wouldnt apply to a 0.
maybe a conditional format would help... can you show me how i would do this?
i want all instances of 0 to be like this : '0',





"Himani" wrote:

You can use this formula for your first string. Use accordinlgy for last
string.

=CONCATENATE("""","(","'",E7,"'",",")

"Mo2" wrote:

this is what one line looks like, for example:

Boom 5 bling 4 ding 3

i want to apply a cell format that would make the cells look like this:

"('Boom', '5', 'bling', '4', 'ding', '3')"


as you can see, the first cell has a double quote and a paranthese.
and the last cell has a closing paranthese and a doublequote.

the rest are wrapped in single quotes followed by a comma.

i've figured out the cell format for all the cells, except the first and
last one.
how would I specify the cell format for the first cell and the last cell?
(its not working for me)

oh, and 2nd question:

Sometimes, the cells with TEXT values in willl sometimes have the NUMBER 0
in them (if a condition is false or what not.)

The 0 wont have the same format applied becuz it is a NUMBER in a text
formatted cell.
. how would i also apply a number cell format? or treat the number as text?

(perhaps a conditional format would help...i just dont know how to write it)

thanks in advance, if you can help with either question




All times are GMT +1. The time now is 10:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com