Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel formula question 1

Status
Not open for further replies.

msnook

Technical User
Joined
Jul 6, 2007
Messages
41
Location
US
I am using the coding below and it is not working quite like I expected. What I am doing is checking the value of a cell. What I am looking for is
1)if cell is NA it returns a ""
2)it returns either an EQ ot an OT based on the value of the cell. If it is below a certain number or above a certain it returns an EQ other wise it returns and OT.

When I use this formula the <> doesn't seem to work. It checks the first argument but not the combination.

ie I have a value of .2503 that I want to return an OT but during IF((0.5422>VLOOKUP($B15,Monday!$C$3:$F$38,4,FALSE)>0.3337)it merely checks to see if .2503 is less then .5422 and return a true.


=IF(ISNA(VLOOKUP($B15,Monday!$C$3:$F$38,4,FALSE)),"",(IF(VLOOKUP($B15,
Monday!$C$3:$F$38,4,FALSE)<0.18655,"EQ",(IF((0.5422>VLOOKUP($B15,Monday!
$C$3:$F$38,4,FALSE)>0.3337),"EQ",(IF(VLOOKUP($B15,Monday!$C$3:$F$38,4,
FALSE)>0.19555,"OT",0)))))))
 
A few things:

* Are you working with times? If so, I find it much easier to read the formula if times look like times. You can do something like this:
[tab]TIMEVALUE("7:00:00")

* You've gone a bit crazy with your parentheses. I think the formula will be easier to read if you eliminate the ones before your nested IFs, like this:
[tab]=IF(condition1,C1True,IF(Condition2,C2True,False))

* Moreover, some of your parentheses are just plain wrong. Your 3rd IF doesn't even make sense because of the parentheses.

And finally, why your formula is failing you....

* The formula stops at the first IF that is true. But you don't look for a value between two other values the way you are trying to (0.5422 > VLOOKUP Result > 0.3337). Instead, break those out into two different IF statements.

So after you do that, reorder your criteria like this.
[tab]- If(ISNA
[tab]- If(< 0.18655
[tab]- If(> 0.5422
[tab]- If(> 0.3337
[tab]- If(> 0.19555

But notice that you don't tell it what to do for values between 0.18655 and 0.19555.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top