=IF Formula to find both < and >

P

paul.michaletz

Hello,
This should be a layup, but I'm stuck:
I'm trying to write a simple excel line which provides a TRUE / FALSE
result, comparing one value with two other values, to ensure that the
single value lies between the other two values. A1<B1<C1.

So, if A1=3, B1=4 and C1=5, I'd like to write a line where if:
A1<B1<C1, I obtain a TRUE result. But if A1=6, B1=4 and C1=5, and I
run A1<B1<C1, I obtain a FALSE result (6>3, which breaks the rule).
I've been trying =IF function, but am only getting good result if I
only compare one value (ie either A1<B1, or B1<C1, but not both).

Thank you for any ideas. I'm very rudimentary in Visual Basic, so was
hoping I could keep this to just Excel lines, but could branch out if
necessary.
 
P

paul.michaletz

Hello,
This should be a layup, but I'm stuck:
I'm trying to write a simple excel line which provides a TRUE / FALSE
result, comparing one value with two other values, to ensure that the
single value lies between the other two values. A1<B1<C1.

So, if A1=3, B1=4 and C1=5, I'd like to write a line where if:
A1<B1<C1, I obtain a TRUE result. But if A1=6, B1=4 and C1=5, and I
run A1<B1<C1, I obtain a FALSE result (6>3, which breaks the rule).
I've been trying =IF function, but am only getting good result if I
only compare one value (ie either A1<B1, or B1<C1, but not both).

Thank you for any ideas. I'm very rudimentary in Visual Basic, so was
hoping I could keep this to just Excel lines, but could branch out if
necessary.

Yeah, that works with simple numbers, but when B1 is a result, such as
C3+C4, I get invalid TRUE/FALSE returns.
 
R

Rick Rothstein \(MVP - VB\)

Yeah, that works with simple numbers, but when B1 is a result,
such as C3+C4, I get invalid TRUE/FALSE returns.

Can you show us an example of that (showing us the values you have in each
of the cells)?

Rick
 
P

paul.michaletz

=AND((A1<B1),(B1<C1))

Thanks, but still getting invalid results. The B1 value is actually a
sum of links to two other data pages: =RTD("XX.RTD", "",
A9,"sell","price") + =RTD(...). Could this be the problem?
 
P

paul.michaletz

Can you show us an example of that (showing us the values you have in each
of the cells)?

Rick

Sure, but it gets a bit lengthy because A1 and C1 are links to a live
feed data source (Galaxc) and B1 is the result of multiple links.

Again, I'm looking for A1<B1<C1, either TRUE or FALSE, where:

A1: =RTD("Galaxc.RTD","",A10,"buy","price")
B1: =D5+D6
C1: =RTD("Galaxc.RTD","",A10,"sell","price")

D5: =RTD("Galaxc.RTD","",A10,"settlement")
D6: =E10+E11
E11: =IF(G10=TRUE,H10,J10)
E12: =RTD("Galaxc.RTD","",A12,"sell","price")
G10: =IF(RIGHT(F10,1) = "0", TRUE, FALSE)
H10: =IF(G10=TRUE, (E10+C10)/2, "bid/ask")
J10: =IF(I10<B10, I10+2.5, I10-2.5)
 

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