if condition is met, cut off first 4 characters

billyheanue

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

Looking to transform

KMGW-S8004-5384

<tbody>
</tbody>

BRAU-R8205

<tbody>
</tbody>
8888301523

<tbody>
</tbody>
KEND-7176

into..

S8004-5384
R8205
8888301523
7176

<tbody>
</tbody>

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

Thanks!
Bill
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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,213,554
Messages
6,114,280
Members
448,562
Latest member
Flashbond

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