Excel help
Author
Discussion

Juanco20

Original Poster:

3,352 posts

224 months

Saturday 16th January 2021
quotequote all
I have a worksheet which has a stock locations in a cell, such as HH-07-A

Is there an easy way to get that in to three separate cells?

768

20,864 posts

127 months

Saturday 16th January 2021
quotequote all
Something like this?

miniman

30,238 posts

293 months

Saturday 16th January 2021
quotequote all
If you mean split it into 3, you need =LEFT and =MID

Juanco20

Original Poster:

3,352 posts

224 months

Saturday 16th January 2021
quotequote all
768 said:
Something like this?
Exactly like that. Cheers

frisbee

5,634 posts

141 months

Saturday 16th January 2021
quotequote all
If the bits you want to split out are variable length you could use the VBA split() function, that would let you split the cell using the hyphen as the delimiter.

I'm very rusty on running macros in cells though.

Alternatively, as suggested above, you could use LEFT, MID, RIGHT and use FIND to locate the hyphens.

paulrockliffe

16,677 posts

258 months

Sunday 17th January 2021
quotequote all
Or if you're in Excel 2016 onwards, open PowerQuery and do all your data manipulations in the 'right' place. If the lengths vary you want to do it using the delimiter option so it just splits on every hyhen.