- My Forums
- Tiger Rant
- LSU Recruiting
- SEC Rant
- Saints Talk
- Pelicans Talk
- More Sports Board
- Fantasy Sports
- Golf Board
- Soccer Board
- O-T Lounge
- Tech Board
- Home/Garden Board
- Outdoor Board
- Health/Fitness Board
- Movie/TV Board
- Book Board
- Music Board
- Political Talk
- Money Talk
- Fark Board
- Gaming Board
- Travel Board
- Food/Drink Board
- Ticket Exchange
- TD Help Board
Customize My Forums- View All Forums
- Show Left Links
- Topic Sort Options
- Trending Topics
- Recent Topics
- Active Topics
Started By
Message
Yet another excel question, something similar to left/right functions
Posted on 3/27/15 at 3:33 pm
Posted on 3/27/15 at 3:33 pm
I have a pretty massive spreadsheet and it has a listing of cost centers in it, by loan account number. About 4,200 of them, of which there are maybe 300 different centers. We are going through a big naming convention change, and I have identified which ones need to be renamed, and which ones need to have a new name altogether. Each cell with a cost center has some descriptions, like city name, area, etc. As well as a 10 digit number in parentheses at the end of it. I have a concatenate formula set up, but what I need to do is insert the new naming convention between the city/area name and the 10 digit number.
So for example, Birmingham would be:
Birmingham: XXXXX (1234567890) and I need to have it look like:
Birmingham: XXXXX - XYZ (1234567890).
I have all of the codes where the XYZ will go identified as well.
I have used a right formula to extract the 10 digit number, but I need a way to get just the characters in the cell prior to that number to show up. Only they are all city/area names so it isn't a standard number of characters so I can't use a simple left formula.
Any ideas?
So for example, Birmingham would be:
Birmingham: XXXXX (1234567890) and I need to have it look like:
Birmingham: XXXXX - XYZ (1234567890).
I have all of the codes where the XYZ will go identified as well.
I have used a right formula to extract the 10 digit number, but I need a way to get just the characters in the cell prior to that number to show up. Only they are all city/area names so it isn't a standard number of characters so I can't use a simple left formula.
Any ideas?
Posted on 3/27/15 at 3:44 pm to TU Rob
quote:
So for example, Birmingham would be:
Birmingham: XXXXX (1234567890) and I need to have it look like:
Birmingham: XXXXX - XYZ (1234567890).
I have used a right formula to extract the 10 digit number, but I need a way to get just the characters in the cell prior to that number to show up. Only they are all city/area names so it isn't a standard number of characters so I can't use a simple left formula.
If the colon consistently follows the city name and doesn't occur within city names, FIND will give its position, and then you can use LEFT.
Posted on 3/27/15 at 3:50 pm to Spock's Eyebrow
quote:
If the colon consistently follows the city name and doesn't occur within city names, FIND will give its position, and then you can use LEFT.
It usually does, but where I put XXXXX are different company names. Some are abbreviations, others are spelled out. I basically need to keep everything that is prior to the Parentheses, so that is where I need the formula to focus on.
Posted on 3/27/15 at 3:57 pm to TU Rob
Played around with some find and replace options. I did find: (* and in the replace field hit delete and then replace all and it worked.
Posted on 3/27/15 at 4:01 pm to TU Rob
Then search for the opening parentheses. You have to identify a consistent pattern, and if it's as simple as "everything in front of a delimiter (e.g. colon or opening paren)", you can use the built-in Excel functions to extract the prefix string. If it's more complicated, and the simple wildcards available with SEARCH don't cut it, you may need to delve into regular expressions, which Excel does support through macros and add-ins. Google /Excel regex/ for more on that.
Posted on 3/30/15 at 10:45 am to TU Rob
Assuming ( is only used once, this formula should work based on the old name in cell A1, the addition needed in cell B1:
=LEFT(A1,FIND("(",A1)-1)&"- "&B1&" "&MID(A1,FIND("(",A1),99)
=LEFT(A1,FIND("(",A1)-1)&"- "&B1&" "&MID(A1,FIND("(",A1),99)
Popular
Back to top
Follow TigerDroppings for LSU Football News