Forums

General Betting

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
panic
28 Apr 10 08:13
Joined:
Date Joined: 19 Oct 03
| Topic/replies: 59 | Blogger: panic's blog
Hi, I have a list of horse names in excel with their country code in brackets such as:

Horse Name (IRE)

..and would like to remove all the info after the horse name so I am just left with the horse name.

Is there any code I could use to do this please?

Thank you in advance.


.
Pause Switch to Standard View Excel help please
Show More
Loading...
Report Equimine.co.uk April 28, 2010 8:31 AM BST
If you go to the Data tab, click on it you will see a button called Text to Columns. it is fairly self explanatory once clicked on. You want the "Delimited" option.
Report starfish and coffee April 28, 2010 9:02 AM BST
but make sure to go back into it after using and clear the instruction, or it will apply to the next thing you copy and paste
Report Sheriff Rosco P. Coltrane April 28, 2010 9:40 AM BST
can you do find and replace to do this
Report Equimine.co.uk April 28, 2010 9:52 AM BST
You could but unless I am mistaken you would need to enter every country code individually.
Report General Midwinter April 28, 2010 10:24 AM BST
Use the LEN function to return the length of the name including the country.

In the next cell deduct 5 from the value of LEN (3 letters + 2 brackets)

Use the LEFT function to give you the text minus the 5 characters removed:

Horses name in cell A1 FORUMITE (IRE)
In B1 formula is LEN (A1) = 14
In C1 formula =(B1-5) = 9
In D1 formula is =LEFT (A1,C1) = FORUMITE (the first 9 characters of A1)
Report Equimine.co.uk April 28, 2010 10:30 AM BST
That seems overly complicated to me.

Text to Columns tab, Delimited, Delimiters "Other" use the first bracket (. Job done, delete the column with the country codes in if not required.
Report starfish and coffee April 28, 2010 10:33 AM BST
and not all country codes are 3 letters depending on the data provider e.g ATR use GB in Irish racing, FR etc
Report aye robot April 28, 2010 10:45 AM BST
If your horses name is in A1, put this formula into A2 & coppy down for other cells:

=LEFT(A1,(SEARCH("(",A1)-2))
Report Compound Magic April 28, 2010 10:55 AM BST
=IF(ISNUMBER(FIND("(",A1,1)),LEFT(A1,FIND("(",A1,1)-2),A1)
Report Ghetto Joe April 28, 2010 11:05 AM BST
just use find and replace it's a lot easier than all the faffing around

press control + H together , where it says Find what: stick in (*) then press the button sayng Replace All
Report Compound Magic April 28, 2010 11:12 AM BST
Ghetto Joe ~ You win, best solution!
Report starfish and coffee April 28, 2010 11:15 AM BST
Well maybe except you have to do it separately for (UK), (IRE), (FRA), (USA) and then check you havent missed any (RSA), (ARG) etc
Report Compound Magic April 28, 2010 11:23 AM BST
If you use Ghetto Joe's (*) change to (*)*
Report Equimine.co.uk April 28, 2010 11:32 AM BST
Why the obsession with making a simple text splitting exercise, that requires about four or five mouse clicks, so complicated?
Report starfish and coffee April 28, 2010 11:33 AM BST
didnt realise the * covers the bracket contents,but doesnt seem to be working even with (*)* ??
Report starfish and coffee April 28, 2010 11:39 AM BST
Sorry (*) etc should work, but the data provider I tested it on limits the characters column length for the horses name
e.g HAIL PROMENADER (IRE
Report Ghetto Joe April 28, 2010 11:55 AM BST
in that case just do another find replace for (* ,starfish
Report Ghetto Joe April 28, 2010 12:00 PM BST
Problem with text to columns is you may have other data in the next columns, Equimine.co.uk.

Sometimes having only a limited knowledge of excel is a bonus ,
Compound Magic :)
Report Equimine.co.uk April 28, 2010 12:05 PM BST
Never heard of inserting a column!
Report Equimine.co.uk April 28, 2010 12:07 PM BST
Or for that matter just don't import the data you don't want. It really is very simple.
Report starfish and coffee April 28, 2010 12:17 PM BST
Well i've always used that method equimime,just 6 clicks does it including add/remove column.
But as far as I can tell the 'dont import column' option just leaves you with the suffix, and not the horse name.
And you do have to reset it afterwards otherwise it will do text to columns removing brackets for anything else you copy and paste on the sheet.
Report panic April 28, 2010 2:18 PM BST
Thanks very much for all the replies, I will try and see what I can do this evening.

Good luck and thanks again.


.
Report Equimine.co.uk April 28, 2010 3:39 PM BST
sandc

You are making sure you don't import the "suffix" column, not the original column which would have the horse name in the case requested.
The copy paste scenario is certainly nothing I have come across.
Report panic April 28, 2010 4:56 PM BST
Thanks again, especially Aye Robot. Your method was very simple, cheers.


.
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com