if condition is met, cut off first 4 characters

billyheanue

Board Regular
Joined
Jul 13, 2015
Messages
109
Hi all,

Looking to transform

[TABLE="width: 138"]
<tbody>[TR]
[TD="class: xl64, width: 138"]KMGW-S8004-5384[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 138"]
<tbody>[TR]
[TD="class: xl66, width: 138"]
BRAU-R8205[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 138"]
<tbody>[TR]
[TD="class: xl66, width: 138"]8888301523[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 138"]
<tbody>[TR]
[TD="class: xl66, width: 138"]KEND-7176

into..

S8004-5384
R8205
8888301523
7176[/TD]
[/TR]
</tbody>[/TABLE]

Is there an excel formula that can handle all of this in one fell swoop?

Thanks!
Bill
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Probably the use of MID but you haven't told us the conditions that have to be met and your result implies that you need to cut off up to five characters.
 
Upvote 0
Thanks Dave - I figured out a way to do it using the LEN function in cell K24

" =IF(MID(J24,5,1)="-",RIGHT(J24,K24-5),J24) "

Hopefully this works for all of the cases
 
Upvote 0
Good stuff Bill. Will keep an eye out in case you it doesn't quite work out ;-)
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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