PROBABLY A REALLY SIMPLE PROBLEM

Please post any questions regarding the program here.

Moderator: 2020vision

PROBABLY A REALLY SIMPLE PROBLEM

Postby Herbie1809 » Fri Sep 07, 2012 9:03 am

Hello Chaps,

I'm completely stuck on something that should probably be really simple.

I have an IF statement in a cell: =IF(Y2<=0,W4+1,1), but it does'nt seem to fire.

The value in Y2 is placed in the cell by VBA code. The value in W4 is a formula (which puts the correct value in the cell.

I've checked the value data types and they're all consistent, and I've checked the VBA code is not continuing to fire. Any ideas?



Cheers.
Only the brave.....
Herbie1809
 
Posts: 40
Joined: Tue Mar 02, 2010 5:37 pm

Postby osknows » Fri Sep 07, 2012 9:27 am

Hello,

Possibly it could the following....

cell Y2 may be being treated as text instead of numeric.

Eg if cell Y2 contains a formula

=IF(F5>2,F5,"")

The "" will show a blank in the cell but it isn't 0.

your formula =IF(Y2<=0,W4+1,1), Y2<=0 won't work in this case

You have 2 options, either
1. Change the formula in Y2 so only numeric data is returned - eg =IF(F5>2,F5,0)

or

2. Update your formula to read
=IF(OR(Y2<=0,Y2=""),W4+1,1)

If t's not that we probably need more info

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

Postby osknows » Fri Sep 07, 2012 1:13 pm

I just realised you're placing the value in Y2 via code. Again it could be the value you're writing is a string. Try using the correct type in VBA such as Long, Double etc or converting the number in VBA CLng, CDbl

Alternatively force Excel to convert by using

=IF(Y2*1<=0,W4+1,1)
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby Herbie1809 » Sun Sep 09, 2012 10:56 am

Cheers, Os. Much appreciated,mate
Only the brave.....
Herbie1809
 
Posts: 40
Joined: Tue Mar 02, 2010 5:37 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 52 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.