Help for a (Hypothetical) Gambler!

Just for fun, I compare ratings for different college football teamsand then compare those ratings to the odds for a given week to come upwith a strategy for (hypothetical) wagering. My spreadsheet has thefollowing columns: A) Favorite B) Favorite Numerical Rating C) UnderdogD) Underdog Numerical Rating E) Numerical Rating Difference F) OddsG) Difference between Numerical Ratings and Odds.

What I do is bold each home team. I would like to create a macro thatwould add 3 points to the numerical rating of each team that isbolded. Any ideas? I am not a big macro creator but would like tostart learning. Also, any ideas on how to learn from the ground up?Any helpful resources?

If you add 3 to a typed-in numerical rating, you risk losing the originalvalue (which will certainly happen) and also risk having the 3 added morethan once, or not removed properly if you got the original bolding wrong.

My preferred solution to this sort of thing is to:

(1) Put the adjustment in a calculated field - in this case, that'spresumably column E.

(2) Write a small VBA function that will return True if the font is bold.Then do the rest in the formula.

In its essentials, this simply returns True or False depending on whetherthe font in the range passed to it is bold or not.

However, note that the act of bolding/unbolding a cell does not actuallyresult in the recalculation of anything. I have inserted the Volatile callto ensure that the cell containing the function call will be recalculatedevery time anything else is recalculated. This is not, of itself, enough toget you a recalculation, but at least an F9 will now cause the calculationto be redone.

How to use it?

Your basic formula for E38 is

=B38-D38

Now, exactly one of A38 or C38 will be bold, to indicate which is the hometeam. (My assumption is that there is always a home team.) Therefore, youcan assume the underdog is the home team if the favourite is not bold.

=B38-D38+IF(IsBold(A38),3,-3)

So add 3 if the favourite is the home team and subtract 3 if it is not.

If neutral games are possible, then

=B38-D38+IsBold(A38)*3-IsBold(C38)*3

relies on the fact that True can be used as 1 and False as 0 in a numericcalculation.