Forums

We want to share an important update with our Betfair Community users.

Over the coming months, the Betfair Community platform will be winding down. The final active day for the platform will be December 21st. From December 22nd, users will no longer be able to access the platform.

Your discussions, insights, engagement, and, most importantly, feedback have helped shape the platform and guided innovation. Your feedback continues to be important to us, and we will continue to listen via our dedicated feedback channels, as well as through product testing and innovations.

To share your feedback and experience, visit: https://support.betfair.com/app/home

Australian

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
BJT
09 Jun 14 04:52
Joined:
Date Joined: 30 Oct 04
| Topic/replies: 27,711 | Blogger: BJT's blog
Anybody any hints on the formula to round up a number to .5?

Working on lines at the moment, I want the 5 above and below the current line which is a decimal number, say 25.367.

I wish to round that up to 25.5.
Show More
Loading...
Report Thebas • June 9, 2014 5:08 AM BST
try ... ROUNDUP(number,num_digits) .. nu_digits = number of decimal places you require
Report earlycrow • June 9, 2014 5:10 AM BST
My nick name is Excel but that has nothing to do with computers
Report henryluca • June 9, 2014 5:13 AM BST
Bit hard to explain....try :

http://spreadsheets.about.com/od/excelfunctions/qt/080422roundup.htm
Report Thebas • June 9, 2014 5:14 AM BST
lol crow


once you've got 1 decimal place rounded up .. then maybe an if < 5 replace with 5 etc .. bit of work but can prob be done
Report BJT • June 9, 2014 5:18 AM BST
Think you can round up to 5, so was thinking maybe extracting the first number after the decimal point, rounding it up to 5 then concatenating? the numbers together to get a usable number that is effectively rounded up to .5?
Report BJT • June 9, 2014 5:22 AM BST
Actually found 2, but still not complete.  MROUND will round to nearest if you use MROUND(number, .5).  CEILING(number, .5) will round up to the nearest .5, but I wish to exclude the 0, I need the .5 for obvious reasons.
Report BJT • June 9, 2014 5:42 AM BST
As per usual, I have it I think.

I have F13 = line.
f14 =(CEILING(F13+0.000013,0.5))
g14 =NOT(MOD(F14,1))
h14 =if(G14=true,FLOOR(F13,0.5),F14)


Seems to give the number rounded to .5.  Not always the closest, but not that important as I plan to go 5 above and 5 below anyway.

Gives
.1 = .5
.6 = .5
1.277 = 1.5
1.7997 = 1.5

I had to include the + 0.0000013 because an integer didn't work and wanted something random that I should never encounter adding that much to something to get an integer.....

Anything I haven't thought of?
Report BJT • June 9, 2014 5:43 AM BST
As per usual ***  supposed to read I have it I think, but have had to spread it across multiple cells very inefficiently....... As per usual......
Report henryluca • June 9, 2014 5:48 AM BST
BJT:

If you enjoy a good equation then work backwards using the bf graph and its associated variables....x and y axis information..... these patterns (and I dont mean up and down) are based upon algorithms .......these algorithms bring together all the information relating to lays and bets and in doing so cause patterns ( again dont mean ups and downs)....create a data base of these patterns (ditto above) ,,,and watch with uncanning regularity the recurring outcomes of certain patterns .....(again I dont mean ups and downs).

Hmmm ...if you enjoy a good equation ( which I gather you do)

anyway...GL with current compilation of data..
Report BJT • June 9, 2014 6:15 AM BST
Think I have it sorted.  Want something for live lines.

For example.  Unitab have Collingwood -33.5 @ 2.10

I have 1.975 for that line.  I am on.
    Collingwood    Melbourne    Line
NOW                    $1.232    $5.311    34.1
Collingwood Goal    $1.176    $6.667    39.886875
Melbourne Goal            $1.308    $4.245    27.886875


Line Betting           
-29.5    $1.824    $2.213    29.5
-30.5    $1.860    $2.163    30.5
-31.5    $1.897    $2.115    31.5
-32.5    $1.935    $2.070    32.5
-33.5    $1.975    $2.026    33.5
-34.5    $2.017    $1.983    34.5
-35.5    $2.061    $1.943    35.5
-36.5    $2.106    $1.904    36.5
-37.5    $2.154    $1.867    37.5
-38.5    $2.203    $1.831    38.5
-39.5    $2.255    $1.797    39.5
Report BJT • June 9, 2014 8:41 AM BST
33 points..  lol..  Got a few on with collects so all good...  Wink
Report secong coming. • June 10, 2014 10:52 PM BST
amount in A1
the formula to round up to half (0.5) is

=ROUNDUP(A1*2,0)/2

or if normal rounding ie: 2.22 would be just 2 (not rounded up to 2.5)

same as above without UP

=ROUND(A1*2,0)/2

GL
Report BJT • June 11, 2014 6:29 AM BST
Thanks, but that just rounds to the nearest .5 right?  I need the number to end in .5, as this is all about line betting.  The lines are always ending in .5 so I don't need any other number.  Whatever number is entered it will work out the relevant odds of that happening, but I need it to tie into what the bookies are offering to know 100% there is value.

For now, I have it working.  While not a very efficient formula, it still gets the job done.  I really could do it all in the 1 cell, but would still be the same formula.

I did try the formula but appears to include 0.

And while realistically I could have simply rounded it up to the next integer, and then added .5 to work out the odds for each line, I think I have it sorted.

Thanks anyway.
Report henryluca • June 11, 2014 7:31 AM BST
CrazyCrazy
Report BJT • June 11, 2014 7:55 AM BST
??
Report secong coming. • June 11, 2014 10:40 PM BST
sorry blowie misread the q
Report secong coming. • June 11, 2014 10:40 PM BST
Silly
Report wombleoz • June 12, 2014 12:17 AM BST
=ROUND(A1/0.5,0)*0.5
Report BJT • June 12, 2014 9:12 AM BST
thanks again, but again, that rounds to the nearest number divisible by .5 as an integer, which is any number ending in .5 or 0.  I need it without the 0.

And I now have it working, just across 3 cells as pointed out earlier.  Tried a couple of times to implement it in 1 cell, but keep getting errors so inclined to just leave as is.

Which is:


I have F13 = line.
f14 =(CEILING(F13+0.000013,0.5))
g14 =NOT(MOD(F14,1))
h14 =if(G14=true,FLOOR(F13,0.5),F14)

What that is saying (by the looks :O)

It is rounding up the line (a decimal number worked out by formulas as to what the real line should be not formatted to end in anything, merely the 2.00 theoretical line, plus a very small fraction (basically used just to prevent a whole number being used which tended to throw up an error), to the nearest .5, either ending in 0 or .5.

It then checks if that number is divisible by 1 to return an integer.  If it does, it means the number doesn't end in .5.

Then I get the number I am looking for.  If the previous formula returns "true" indicating an integer, then it must mean that the initial line was raised up to find the next .5 increment.  So instead of worrying about any calculations, it will round it down instead to the closest .5.

So basically, it will round anything to the nearest number ending in .5 and only .5.


I believe this is what is happening anyway and seems to work.

Ultimately, the number it rounds to isn't really that important in the scheme of things (in regards to odds calculation) as whatever number it returns will be calculated after being rounded to work out the odds.
eg, just say the line is worked out to be 6.7983422569922.
My formula will initially raise it to 7.0, check to find it ends in .0 then retry and round it down to 6.5 instead.
The number 6.5 is entered in another cell, and the odds of both teams ending more than that -6.5, and the underdog ending that much in front +6.5, and give the correct odds and probability of it happening.
It has already worked out the odds for 6.7983422569922 as being 2.00. 
So if the formula was rounding up from 6.79***** and somehow gave a figure of 1350 or something random, then it would work out the odds for 1350+-, and not show 2.00 for that line.


Either way, I believe this formula (array of formulas ffs) will round down any number from **.5 (minus the insignificant earlier addition number) up to **.00, and round up to the nearest .5 any number between **.00 and **.50 and should never encounter a problem unless the initial number is exactly .0000013 short of an integer, which I am assuming I will not see in my lifetime.
Report BJT • June 12, 2014 9:15 AM BST
So at this point, unless somebody has a more efficient way of doing what I have already working, either by the proper formula, or combining my 3 cells into just 1 formula, then everything is apples, and this thread is probably dead.
Report HarryHindsight • June 12, 2014 10:59 PM BST
Have you had a look at doing it in vba ?
Google will help you with the rounding. Use Worksheet change to pick up any change in a columns value to initiate a recalculation in another column.
my .02c

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then

Target.Offset(0, 1).Value = yourvalue
End If
End Sub
Report HarryHindsight • June 12, 2014 11:17 PM BST
http://www.mrexcel.com/forum/excel-questions/383945-5-not-rounding-up-round-...
Report secong coming. • June 13, 2014 2:09 AM BST
broken link there HH
Report BJT • June 13, 2014 5:16 AM BST
Yeah, problem is that I have it in Google Docs and I don't think that is an option.  After numerous hard drive crashes and the loss of thousands upon thousands of hours work, I now only have bots and DB spreadsheet in Excel.
My trading and betting sheets are all online so I can bet wherever I am at the time.

In saying that though, I am contemplating putting some buttons and such for easier score/time keeping to keep the sheet live easier, and will certainly look at VBA coding a lot of it in.

While I am not a coder, I have been able to learn how to code some pretty funky siht into my DB sheet all through the help of online.

But then, to be able to code something like that, would require knowing the formula, and while it would be worded differently in code, it would still need to be an actual formula.  Right?

I like that Worksheet Change suggestion, I think I can utilise that elsewhere, but once I know the initial line, no number would change unless the score or time changed and if I set them up with buttons, then I can simply adjust any numbers at the end of that code.

Thanks though.  Food for thought.
Report BJT • June 13, 2014 5:59 AM BST
And only now I realise how ridiculous the thread title is.  PlainPlain
Report Compound Magic • June 15, 2014 4:48 AM BST
To the closest .5

=FLOOR(A1+0.25,.5)
A1 being the cell with the value to evaluate
Cheers.
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com