Forums
Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
Stevie Strikes
18 Feb 17 14:01
Joined:
Date Joined: 27 Apr 04
| Topic/replies: 1,279 | Blogger: Stevie Strikes's blog
Function bfBakWin(Pos, bfSP, Optional IDref As String)
    bfBakWin = -1
    If bfSP = 0 Then bfBakWin = 0: Exit Function
    If Pos = 1 Then
        bfBakWin = XUstk(Round(((bfSP - 1) * RedFact(IDref)) * CommNet, 2))
    End If
End Function

For me.
Pause Switch to Standard View Whats your fav Excel user-defined...
Show More
Loading...
Report Dotchinite February 18, 2017 1:02 PM GMT
Was just about to post that.
Report mememe February 18, 2017 1:09 PM GMT
I lay horses.

My fav is    if(cell="w",((cell-1)*-100),100).

Simple but effective, providing the fookin horse gets beaten.
Report Ovalman. February 18, 2017 1:57 PM GMT
That if statement does nothing?^^
Report mememe February 18, 2017 3:29 PM GMT
Ovalman,

it works for me, but I'm not gonna tell you which ones to layLaugh
Report Ovalman. February 18, 2017 3:54 PM GMT
I don't know excel but if statements should have conditions

    If bfSP = 0 Then bfBakWin = 0: Exit Function
    If Pos = 1 Then


Yours has no conditions Excited
Report Just Checking February 18, 2017 7:01 PM GMT
The = is to test equals, as it's basic.
The : AFAIK joins up everything to the right of his Then, so both are done. In english: "set as zero and then exit".

Condition THAT! *drops mic and walks off* Laugh
Report Ovalman. February 18, 2017 7:05 PM GMT
No experience of Excel

What does if(cell="w",((cell-1)*-100),100) mean.
Report Stevie Strikes February 18, 2017 10:17 PM GMT
Should have been:

Function bfBakWin(Pos, bfSP, Optional IDref As String)
    bfBakWin = XUstk(-1)
    If bfSP = 0 Then bfBakWin = 0: Exit Function
    If Pos = 1 Then
        bfBakWin = XUstk(Round(((bfSP - 1) * RedFact(IDref)) * CommNet, 2))
    End If
End Function


Where Pos = finishing position and bfSP = BF starting price
Idref is the unique race ID reference
RedFact checks Idref against a table of races subject to r4 deductions and dead heats
and returns a reduction factor (1 if their are none)
CommNet returns the result net of commission.
Ustk = returns the above calculation * your unit stake

I shall now repair to General Betting for a similarly lukewarm response.
Report mememe February 19, 2017 12:28 PM GMT
Ovalman.
18 Feb 17 19:05
Joined: 29 Nov 02
| Topic/replies: 14,009 | Blogger: Ovalman.'s blog
No experience of Excel

What does if(cell="w",((cell-1)*-100),100) mean.


I keep a spreadsheet to capture my history.  Each row shows whether the selection won (w) or lost (blank).  The logic in the formula looks at the cell containing w or blank, and then takes the price I got for my lay bet, and calculates whether I won money or lost money and how much.

Of course I could just look at my Betfair P&L, but being a former accountant, I like to have some checks and balances.  Betfair have been known to make the occasional error.
Report Ovalman. February 19, 2017 3:57 PM GMT
I'm developing a few Android apps atm so these things interest me. I always meant to learn excel but it's on the back burner as I get to grips with Java.

If you learn one language, all the rest seem to fall into place imo.
Report mememe February 19, 2017 4:29 PM GMT
Ovalman, GL with that.

Many, many years ago I bought a home computer and was learning to write in BASIC.

I wrote a dice game programme with automatic scoring for each player for the kids.  I wrote little modules and kept testing them.

I then put them all together and the fookin machine got over excited and scrambled everything!!

It had only got 16k of RAM and I think I made its head hurt.

Never again. LaughLaugh
Report Clouseau February 19, 2017 5:39 PM GMT
I've got a question time function:
if x=1, blame Brexit, Trump, Racism, Hitler, Fascism, Islamophobia and Bankers = round of applause.
End function
Report Ovalman. February 19, 2017 5:40 PM GMT
That's how I got started, bought myself a ZX81 and there was nothing else to do on it but learn to program. Upgraded to a ZX Spectrum but then my willy got bigger and women were more appealing than computers Excited

Tried several times in the past to get back into it but everything seemed so alien. Object Orientated Programming talked about building feckin houses FFS and you had to use Notepad++ and a compiler to run things. Not a wonder I struggled.

I stuck with it tho, kept trying and then done a free course on Udacity where everything seems to have clicked. I'm working on a business idea atm which I think would sell, there's nothing on the app store that has been addressed so I think it has a unique selling point. The great thing is the line of business is not a niche so I'd have many potential customers. I've a basic working app atm but not ready for the app store.

I've other ideas but I don't think your ever too old to learn. I'm 48 and still try, that's why I questioned the if statement Wink
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com