UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Nested If, Any Version    
 
   
access2009eg
post Sep 16 2019, 01:31 PM
Post#1



Posts: 1,126
Joined: 19-February 08



Hello Friends;
is there any difference between using this code and if i use nested if
CODE
=IF(A1<=49,"Fail","")&""&IF(AND(A1>=50,A1<=65),"good","")&""&IF(AND(A1>=65,A1<=75),"very//","")&""&IF(AND(A1>=75,A1<=85),"very good","")&""&IF(A1>=85,"Excellent","")

--------------------
I would like to Thank you for your help
Go to the top of the page
 
June7
post Sep 16 2019, 01:50 PM
Post#2



Posts: 867
Joined: 25-January 16



The output should be same. Should not have both <=85 as well as >=85 (85 will always match the first one), pick one for clarity.

=IF(A1<=49,"Fail", IF(A1<=65,"good", IF(A1<=75,"very//", IF(A1<=85,"very good", IF(A1>85,"Excellent","")))))

This post has been edited by June7: Sep 16 2019, 01:55 PM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG! http://www.cpearson.com/Excel/DebuggingVBA.aspx
Go to the top of the page
 
Debaser
post Sep 18 2019, 06:35 AM
Post#3



Posts: 147
Joined: 11-October 18



Nested IF would be more efficient. You could also use a LOOKUP, either with a table or using array constants:

=LOOKUP(A1,{0,50,65,75,85},{"Fail","good","very//","very good","Excellent"})
This post has been edited by Debaser: Sep 18 2019, 06:37 AM
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    15th October 2019 - 11:33 PM