Reputation: 141
I have a column that has dates, days, and times in it. I need to split out just the time but there are multiple hyphens, how can I achieve this? Below is what I have.
Recording Time |
---|
Monday July 11 2022 - 8:00am - 10:00am |
This is what I want
| Monday July 11 2022 | 8:00am - 10:00am |
Upvotes: 0
Views: 4410
Reputation: 3
If the columns are going to be consistent, I would use the "Fixed width" option instead of "Delimited". You can tell it exactly where you want the field to be split, specify the formatting for each new column, etc.
Upvotes: -1
Reputation: 8375
I would also try:
=left(A1,find("-",A1,1)-2)
And
=mid(A1,find("-",A1,1)+2,len(A1))
Which will split either side of the first -
.
Check for the formatting for your results.
Upvotes: 3
Reputation: 3119
Another solution is to temporarily avoid the second hyphen with some find and replace actions:
m -
replace with m +
m +
replace with m -
The use of the +
character is simply a convenient choice here.
Upvotes: 1