if < and >

S

saziz

Hi All,
What is the cyntax for "IF" statement

I like to test a cell for a value > 29.7 and < 30.3

Thanks for the help.
Sye
 
D

Dave Peterson

=if(and(a1>29.7,a1<30.3),"between","not between")
or
=if(and(29.7<a1,a1<30.3),"between","not between")

I think I like the second one. It kind of looks like A1 should be trapped
between the two values.
 
S

swatsp0p

You don't tell us what you want to do with the IF statement, but i
would look something like this:

=IF(AND(A1>29.7,A1<30.3),"In Range","Out of Range")

Does this work for you?

Bruc
 
S

swatsp0p

Dave said:
=if(and(a1>29.7,a1<30.3),"between","not between")
or
=if(and(29.7<a1,a1<30.3),"between","not between")

I think I like the second one. It kind of looks like A1 should be
trapped
between the two values.

Dave Peterson

Dave is into bondage? All righty, then. It gets the job done.
 
S

saziz

Thank you all for help.
Here is the scenario I am trying to fit your cyntax:

If .Value < 30.3 Then
.Offset(0, 1).Value = .Value

if I use this "IF(AND.value(A1>29.7,A1<30.3)
it gives me an error.

Any idea?
Thanks
syed
 
M

MrShorty

Is this a worksheet function or a VBA statement? Your last post make
me think you are referring to a VBA statement which would look like

If .value>29.7 and .value<30.3 then
statement
Else
statement
End i
 
A

AlfD

Hi!

Not being unkind, but it helps your helpers if you define the proble
and its context as precisely as you can.

Al
 
Top