Hi
just following on Trevor's comments ... i've got John Walkenbach's Excel
2003 formulas book (and his programming one) and i think they're definitely
worth the money. However, Debra Dalgleish's site
(
www.contextures.com/tiptech.html) and Chip Pearson's (
www.cpearson.com) are
two places i have also learnt a lot about constructing formulas (and, of
course, these newsgroups).
With an IF statement if i know the number of variations and they're under 4
then i start with the lowest and work upwards ... if, however, they're over
4 then i start in the middle as you can only nest 7 IF functions together,
and then as Trevor said (re the ROUND bit) you do that last to make it look
pretty.
FYI here's a breakdown of the formula i gave you
four functions were used:
ROUND(thing to round, number of significant digits)
-here i wanted to round the whole thing to 2 significant digits
IF(test, true, false)
-this is the primary function to use when you want to return different
values based on whether or not a statement is true or false. You can nest
up to 7 IFs in both the true & false section of the first IF
=IF(test,IF(test,true,false),IF(test,true,false)) - structure of an IF with
another IF in the true bit & one in the false bit
MAX(value1,value2)
-returns the maximum from two or more values ... i used this as you said the
minimum charge was .45 so i had to say, if the fee works out less than that
return .45, or if it is more then return that.
MIN(value1,value2)
-returns the minimum from two or more values ... like the MAX one, i used
this to ensure that the fee was the maximum due OR 199, which ever was the
smallest.
the only tricky bit them was dealing with the different criterias in the IF
statement - and this boils down to the following structure in the case of
your formula
=IF(test,true,IF(test,true,IF(test,true,false)))
all nested in the ROUND function
=ROUND(IF(test,true,IF(test,true,IF(test,true,false))),2)
Hope this helps explain it.
Cheers
JulieD