Operator for "between"

A

atom

= means "greater than or equal to", but is there an operator for
"greater than x, but less than y"?

thanks
 
D

DavidObeid

If you want to test if a value in A3 is between the contents of A1 and
A2 then you could use the following:

=IF(AND(A3<=A2,A3>A1),"true","false")

This will return "true" if the value in cell A3 is between the value in
cell's A1 and A2 or "false" if it is not (assuming that A1<A2).


Does this help?
 
A

atom

{=SUM(($K$7:$K$300={"Mon.","Tue.","Wed."})*($E$7:$E$300=4))}

This array formula works fine for counting the cells that meet these
conditions, but I want to have the value at the end be between 4 and 7.

Thanks!
 
B

Biff

Hi atom,

Try this: (not an array)

=SUMPRODUCT((K7:K300={"MON.","TUE.","WED."})*(E7:E300>=4)*
(E7:E300<=7))

Biff
 
A

atom

I tried this formula, but it doesn't seem to recognize the last part -
my total is the same with or without the <=7...
 
B

Biff

Hi atom,

That should work. You can modify your SUM formula the same
way and should get the same result, array entered:

=SUM((K7:K300={"Mon.","Tue.","Wed."})*(E7:E300>=4)*
(E7:E300<=7))

=SUMPRODUCT((K7:K300={"MON.","TUE.","WED."})*(E7:E300>=4)*
(E7:E300<=7))

These two formulas essentially do the same thing and will
return the same result. The SUMPRODUCT function takes
arrays as arguments and is more efficient than the array
entered SUM function.

Another alternative array entered:

=SUM(IF(K7:K300={"MON","TUE","WED"},IF(E7:E300>=4,IF
(E7:E300<=7,1,0))))

If none of these formulas work, post back with more detail
on your data.

Biff
-----Original Message-----
I tried this formula, but it doesn't seem to recognize the last part -
my total is the same with or without the <=7...
Hi atom,

Try this: (not an array)

=SUMPRODUCT((K7:K300={"MON.","TUE.","WED."})* (E7:E300>=4)*
(E7:E300<=7))

Biff
-----Original Message-----
{=SUM(($K$7:$K$300={"Mon.","Tue.","Wed."})* ($E$7:$E$300=4))}

This array formula works fine for counting the cells
that
meet these
conditions, but I want to have the value at the end be between 4 and 7.

Thanks!

DavidObeid wrote:

If you want to test if a value in A3 is between the contents of A1 and
A2 then you could use the following:

=IF(AND(A3<=A2,A3>A1),"true","false")

This will return "true" if the value in cell A3 is between the value in
cell's A1 and A2 or "false" if it is not (assuming
that
A1<A2).
Does this help?

------------------------------------------------
[/url]
~~View and post usenet messages directly from http://www.ExcelForum.com/

.

.
 
A

atom

Thanks so much!
Hi atom,

That should work. You can modify your SUM formula the same
way and should get the same result, array entered:

=SUM((K7:K300={"Mon.","Tue.","Wed."})*(E7:E300>=4)*
(E7:E300<=7))

=SUMPRODUCT((K7:K300={"MON.","TUE.","WED."})*(E7:E300>=4)*
(E7:E300<=7))

These two formulas essentially do the same thing and will
return the same result. The SUMPRODUCT function takes
arrays as arguments and is more efficient than the array
entered SUM function.

Another alternative array entered:

=SUM(IF(K7:K300={"MON","TUE","WED"},IF(E7:E300>=4,IF
(E7:E300<=7,1,0))))

If none of these formulas work, post back with more detail
on your data.

Biff
-----Original Message-----
I tried this formula, but it doesn't seem to recognize the last part -
my total is the same with or without the <=7...
Hi atom,

Try this: (not an array)

=SUMPRODUCT((K7:K300={"MON.","TUE.","WED."})* (E7:E300>=4)*
(E7:E300<=7))

Biff

-----Original Message-----
{=SUM(($K$7:$K$300={"Mon.","Tue.","Wed."})*
($E$7:$E$300=4))}

This array formula works fine for counting the cells that
meet these
conditions, but I want to have the value at the end be
between 4 and 7.

Thanks!

DavidObeid wrote:

If you want to test if a value in A3 is between the
contents of A1 and
A2 then you could use the following:

=IF(AND(A3<=A2,A3>A1),"true","false")

This will return "true" if the value in cell A3 is
between the value in
cell's A1 and A2 or "false" if it is not (assuming that
A1<A2).

Does this help?

------------------------------------------------
[/url]
~~View and post usenet messages directly from
http://www.ExcelForum.com/

.

.
 
Top