Excel-Help-Ideas

Please post any questions regarding the program here.

Moderator: 2020vision

Excel-Help-Ideas

Postby mak » Mon Nov 23, 2009 12:31 pm

Hi,
I am downloading some statistics about Jockeys & Trainers from Massey site
which I want to trigger if they match with the Jockey names that BA gives

1. The 1st problem & probably easier to workaround is when I have to add a full stop in some names

BA= A. P. McCoy
Massey= A P McCoy

In order to match it with vlookup I am placing manual in Massey names a full stop & it's ok. Is there a formula that could help me with this?

2. In some selections the names are like following

BA = Robert Thornton
Massey = R Thornton

I can't figure out how I can match them...

Any suggestions?
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby Ian » Mon Nov 23, 2009 12:47 pm

Problem 2.

I've used the following formula to edit golfers' names.

=LEFT(A5,1)&" "&RIGHT(A5,LEN(A5)-FIND(" ",A5))

Obviously A5 will need changing to whatever column the jockey's name comes in your spreadsheet.
Ian
 
Posts: 834
Joined: Sat Nov 19, 2005 8:35 am
Location: Birmingham

Postby mak » Mon Nov 23, 2009 1:00 pm

Ian thanks
now I have to deal with 1
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby osknows » Mon Nov 23, 2009 1:22 pm

=SUBSTITUTE(SUBSTITUTE(B7," ",""),".","")

if B7 is

A. P. McCoy = APMcCoy

A P McCoy = APMcCoy
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby osknows » Mon Nov 23, 2009 1:37 pm

Also found this which may help. If you have 2 cells, say A1 and A2

=Fuzzy(A1,A2) returns the % match between the 2 cells. Testing on your examples above gave 100% :)

Copy this into a module
Code: Select all
Dim TopMatch         As Integer
Dim strCompare       As String
Function Fuzzy(strIn1 As String, strIn2 As String) As Single
 Dim L1 As Integer
Dim In1Mask(1 To 24) As Long 'strIn1 is 24 characters max
Dim iCh As Integer
Dim N As Long
Dim strTry As String
Dim strTest As String

TopMatch = 0
L1 = Len(strIn1)
strTest = UCase(strIn1)
strCompare = UCase(strIn2)

For iCh = 1 To L1
 In1Mask(iCh) = 2 ^ iCh
 Next iCh

'Loop thru all ordered combinations of characters in strIn1
For N = 2 ^ (L1 + 1) - 1 To 1 Step -1
 strTry = ""
For iCh = 1 To L1
 If In1Mask(iCh) And N Then
 strTry = strTry & Mid(strTest, iCh, 1)
 End If
 Next iCh
If Len(strTry) > TopMatch Then TestString strTry
 Next N

Fuzzy = TopMatch / CSng(L1)
End Function
Sub TestString(strIn As String)
 
 Dim L As Integer
Dim strTry As String
Dim iCh As Integer

L = Len(strIn)
If L <= TopMatch Then Exit Sub

strTry = "*"

For iCh = 1 To L
strTry = strTry & Mid(strIn, iCh, 1) & "*"
Next iCh

If strCompare Like strTry Then
If L > TopMatch Then TopMatch = L
End If

End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby mak » Mon Nov 23, 2009 1:57 pm

Thanks Os
I tested the formula & worked fine of course & definitely I will try the module

I am ready now to go & lose some money :)

Thanks again both

*really super forum
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby mak » Tue Nov 24, 2009 5:45 pm

Hi again (little more help needed)

I have manage to get the weight figures (Age/Weight from AF column) in one cell

something like

10-12
8-10
10-9

How can I sort them to find the top 6 Most Weighted?
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby osknows » Tue Nov 24, 2009 6:04 pm

Assume
A1 is 10-12
A2 is 8-10
A3 is 10-9

C1=LEFT(A1,FIND("-",A1,1)-1)*14+RIGHT(A1,LEN(A1)-FIND("-",A1,1))
C2=LEFT(A2,FIND("-",A2,1)-1)*14+RIGHT(A2,LEN(A2)-FIND("-",A2,1))
C3=LEFT(A3,FIND("-",A3,1)-1)*14+RIGHT(A3,LEN(A3)-FIND("-",A3,1))

This converts everything to pounds first. Then in cells

D1=RANK(C1,$C$1:$C$3,1)
D2=RANK(C2,$C$1:$C$3,1)
D3=RANK(C3,$C$1:$C$3,1)

Will rank them highest to lowest
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby mak » Tue Nov 24, 2009 6:26 pm

Thanks Os again & again.....
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 38 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.