Split column data to two columns

willbost

New Member
Joined
Jun 16, 2006
Messages
21
I have a field "Client-Dept" that contains the following type of data:

00-825
00-4255
00-588

I want to create a query that takes this field and spits into a Client field and Dept field.

For client, I am using the "Left([Client-Dept],2)" But since the Dept field varies on length, I cannot use the "Right" function. Somehow I need to split and get the data after the "-".

Thanks!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Use the MID function:

Mid([Client-Dept], Instr(1, [Client-Dept], "-") + 1)

(the function takes 3 arguments but I used two as the last argument is optional so if you leave it off it takes the remainder of the text after the starting point.)
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,259
Members
452,901
Latest member
LisaGo

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