Having trouble with an IF function

Good afternoon,

I'm trying to use an IF function to return different values of one parameter when given another input parameter. There are three possible output values which are dependant on the size of the original. Below is my attempt at making a working IF function to achieve this:

=IF(B2<8,0.95,IF(8<=B2<=14,1,IF(14<B2,1.05,)))

I am getting an error saying that "you cannot compare a Boolean with a number because their data types are different"

This is what has stumped me. It may well be due to my own lack of knowledge of Boolean algebra, but I would greatly appreciate any assistance you may be able to offer.

Kind regards

MacBook Pro 15", Mac OS X (10.5.1)

Posted on Mar 22, 2011 9:27 AM

Reply
6 replies

Mar 22, 2011 10:17 AM in response to cave.g

Do you know that reading *_iWork Formulas and Functions User Guide_* is useful

If there is a function named AND, it's because 8<=B2<=14 is not allowed.
I wish to add that checking that 8<=B2 when the value passed the first test B2<8 is a bit absurd.

Same comment for your third IF.

In fact your formula must be :

=IF(B2<8,0.95,IF(B2<=14,1,1.05))
or

=IF(B2<8,0.95,IF(B2>14,1.05,1))

Yvan KOENIG (VALLAURIS, France) mardi 22 mars 2011 18:16:57

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Having trouble with an IF function

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.