How do I set up a formula with multiple conditions?

G

Guest

I need to know how to develop a formula that will look at "x" "y" and see if
either is between both "a" and "b" ie.:

x=d2
y=d6
a=a12
b=b12

If(d2>a12 and d6<b12,d6-d2,0)
 
G

Guest

This formula tests D2 first, then D6. So even if D6 satisfies both
conditions, it will still read "D2 is between both" if D2 satisfies both
conditions:

=IF(AND(D2>A12,D2<B12),"D2 is between both",IF(AND(D6>A12,D6<B12),"D6 is
between both","Both tests failed"))

Or maybe you're looking for something like:

=IF(OR(AND(D2>A12,D2<B12),AND(D6>A12,D6<B12)),"D2 and/or D6 are between
both","D2 and D6 both failed")

HTH
Jason
Atlanta, GA
 
G

Guest

=+IF(D2>A12,IF(D2<B12,IF(D6>A12,IF(D6<B12,C1-B1,0))))
Fred: This will work. It's called an embedded if statement. You a just
using four ifs all together. Just remember for every open parenthesis, you
must have a close parenthesis.
 
G

Guest

Jason, thanks for your help!

Jason Morin said:
This formula tests D2 first, then D6. So even if D6 satisfies both
conditions, it will still read "D2 is between both" if D2 satisfies both
conditions:

=IF(AND(D2>A12,D2<B12),"D2 is between both",IF(AND(D6>A12,D6<B12),"D6 is
between both","Both tests failed"))

Or maybe you're looking for something like:

=IF(OR(AND(D2>A12,D2<B12),AND(D6>A12,D6<B12)),"D2 and/or D6 are between
both","D2 and D6 both failed")

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top