close

I was trying to take off hyphen within a text string, such as quot;0100-00-000quot;.
I used LEFT formula to return the first 4 digit. Then I used RIGHT formula
on the same cell to return the last 3 digit but somehow the formula doesn't
work. It won't give me a error message but just keep my formula in the cell.

Please help and thanks

Format the cell as General and re-enter the formula.
If you post again, do supply the formula.

--
Kind regards,

Niek Otten

quot;Bonnie W.quot; lt;Bonnie gt; wrote in message
...
gt;I was trying to take off hyphen within a text string, such as
gt;quot;0100-00-000quot;.
gt; I used LEFT formula to return the first 4 digit. Then I used RIGHT formula
gt; on the same cell to return the last 3 digit but somehow the formula
gt; doesn't
gt; work. It won't give me a error message but just keep my formula in the
gt; cell.
gt;
gt; Please help and thanks
Assuming that the string value is in A1, the following formula will strip the
hyphens from the value:

=LEFT(A1,FIND(quot;-quot;,A1,1)-1)amp;MID(A1,FIND(quot;-quot;,A1,1) 1,FIND(quot;-quot;,A1,FIND(quot;-quot;,A1,1) 1)-(FIND(quot;-quot;,A1,1) 1))amp;RIGHT(A1,3)
--
Kevin Backmannquot;Bonnie W.quot; wrote:

gt; I was trying to take off hyphen within a text string, such as quot;0100-00-000quot;.
gt; I used LEFT formula to return the first 4 digit. Then I used RIGHT formula
gt; on the same cell to return the last 3 digit but somehow the formula doesn't
gt; work. It won't give me a error message but just keep my formula in the cell.
gt;
gt; Please help and thanks

If you are not getting an error message, and you can see the formula after
entered, then you probably have the cell formatted as text. Format it as
general, and then re-edit the cell (select the cell, hit F2, hit enter).

Also, you can try this formula. It will remove all quot;-quot; from the text string.

=SUBSTITUTE(A1,quot;-quot;,quot;quot;)

quot;Bonnie W.quot; wrote:

gt; I was trying to take off hyphen within a text string, such as quot;0100-00-000quot;.
gt; I used LEFT formula to return the first 4 digit. Then I used RIGHT formula
gt; on the same cell to return the last 3 digit but somehow the formula doesn't
gt; work. It won't give me a error message but just keep my formula in the cell.
gt;
gt; Please help and thanks

quot;Bonnie W.quot; lt;Bonnie gt; wrote in message
...
gt;I was trying to take off hyphen within a text string, such as
gt;quot;0100-00-000quot;.
gt; I used LEFT formula to return the first 4 digit. Then I used RIGHT formula
gt; on the same cell to return the last 3 digit but somehow the formula
gt; doesn't
gt; work. It won't give me a error message but just keep my formula in the
gt; cell.

If the cell is formatted as 'text' then you'll need to change it to
'general' and then edit the formula to refresh it.

If you just want to remove the dashes from the string then try
=SUBSTITUTE(A1,quot;-quot;,quot;quot;)

This returns the value as a string. If you want it to be interpreted as a
number then add two minus signs like this
=--SUBSTITUTE(A1,quot;-quot;,quot;quot;)
If all you want to do is eliminate the hyphens, you can do that with the Edit
gt; Replace gt; Replace hyphen gt; with nothing (leave blank) gt; Replace all

Vaya con Dios,
Chuck, CABGx3quot;Bonnie W.quot; wrote:

gt; I was trying to take off hyphen within a text string, such as quot;0100-00-000quot;.
gt; I used LEFT formula to return the first 4 digit. Then I used RIGHT formula
gt; on the same cell to return the last 3 digit but somehow the formula doesn't
gt; work. It won't give me a error message but just keep my formula in the cell.
gt;
gt; Please help and thanks

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()