ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Need a forumla help (https://www.excelbanter.com/excel-worksheet-functions/167380-need-forumla-help.html)

Igneshwara reddy[_2_]

Need a forumla help
 
Hi,

The data is like this,

1abcde2
stuvwxyz
bcdef49853912

For every first and last character in a cell has to be replaced with %

Ex: for first cell the answer will be %abcde%

Let me know if any forumla will be helping me.

Appreciated your help in advance.

JE McGimpsey

Need a forumla help
 
One way:

="%" & MID(A1,2,LEN(A1)-2) & "%"


In article ,
Igneshwara reddy wrote:

Hi,

The data is like this,

1abcde2
stuvwxyz
bcdef49853912

For every first and last character in a cell has to be replaced with %

Ex: for first cell the answer will be %abcde%

Let me know if any forumla will be helping me.

Appreciated your help in advance.


Don Guillett

Need a forumla help
 

Sub addchar()
For Each c In Range("h2:h4")
c.Value = "%" & c
c.Value = c & "%"
Next c
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Igneshwara reddy" wrote in
message ...
Hi,

The data is like this,

1abcde2
stuvwxyz
bcdef49853912

For every first and last character in a cell has to be replaced with %

Ex: for first cell the answer will be %abcde%

Let me know if any forumla will be helping me.

Appreciated your help in advance.



Don Guillett

Need a forumla help
 
or
Sub addchar()
For Each c In Range("h2:h4")
c.Value = "%" & c & "%"
Next c
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Igneshwara reddy" wrote in
message ...
Hi,

The data is like this,

1abcde2
stuvwxyz
bcdef49853912

For every first and last character in a cell has to be replaced with %

Ex: for first cell the answer will be %abcde%

Let me know if any forumla will be helping me.

Appreciated your help in advance.




All times are GMT +1. The time now is 09:15 AM.

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