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!

how to use a if_and_or statement 1

Status
Not open for further replies.

jrgb

Technical User
Joined
Mar 7, 2003
Messages
2
Location
US
I am trying to use a logical statement that utilizes the logical arguments if, and, & or to drive a function. since excel allow only 7 nested if statements i am in trouble unless this posible (at least from the perspective of my limited knowledge of spreadhseet programming).

what i want to do:

IF(AND(E27=0,G27=0),OR(E27=0,G27>0), *FUNCTION*)

any suggestions?
thx, jrgb
 
Might be able to answe your question easier if I had some more information on what you are doing but here is an example that I put in a earlier post that has 12 if's and have used it for up to 26.... hope this can direct you in the right direction.

=IF(OR($K5<199,$K5<999,$K5<2999,$K5<4999,$K5<9999,$K5<14999),IF($K5<199,&quot;None&quot;,IF($K5<999,&quot;Flyball&quot;,IF($K5<2999,&quot;Intermedate&quot;,IF($K5<4999,&quot;Graduate&quot;,IF($K5<9999,&quot;Advanced&quot;,&quot;Silver&quot;))))),IF(OR($K5<14999,$K5<19999,$K5<24999,$K5<59999,$K5<89999,$K5<100000),IF($K5<14999,&quot;Gold&quot;,IF($K5<19999,&quot;Blue&quot;,IF($K5<24999,&quot;Platinum&quot;,IF($K5<59999,&quot;Aluminum&quot;,IF($K5<89999,&quot;Steel&quot;,&quot;Titanium&quot;)))))))

Regards -

Wray
 
I am trying to calaculate reaction forces on a cantilever beam based on the distance the supports are along the beam and where the point loads are in relation to the supports.

for instance if the left support is located at the left end of the beam then e27=0. in the case that the point loads are all between supports and the right support is at right end of the beam or it is to the left of the right end, then g27=0 or g27>0 and the reaction force is computed the same way.

so what i want is to ask excel IF e27=0 AND g27=0 OR e27=0 AND g27>0 THEN calculate the reaction force equation.

the problem is the excel help file informs me that you can have seven nested if statements so i want to save these for other conditions that arise from different placements of the suports and the point loads.
thx for the reply.
 
well, you only need 1 IF for that initial statement:
=IF(OR(AND(E27=0,G27=0),AND(E27=0,G27>0)),TRUE,FALSE)
Actually, you don't even need that:
=IF(AND(E27=0,G27>=0),TRUE,FALSE)
will also do Rgds
Geoff
&quot;Some cause happiness wherever they go; others whenever they go.&quot;
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top