if statement - How to write this nested IF function in Excel -


i trying write following function in excel.

if p2 greater or equal 3 , ad2 0 or if p2 greater or equal 2 , ad2 greater or equal 1 or if p2 greater or equal 1 , ad2 2

then following: (h2+v2)/(p2+ad2),-999)

i have had go @ writing following no avail.

=if(and(p2>=3,ad2>=0),or(and(p2>=2,ad2>=1)),or(and(p2>=1,ad2>=2)),(h2+v2)/(p2+ad2),-999)

any pointers in right direction appreciated novice @ excel functions.

many thanks,

ash

erm...

i think right:

=if(or(and(p2>=3,ad2=0),and(p2>=2,ad2>=1),and(p2>=1,ad2=2)),(h2+v2)/(p2+ad2),-999) 

you need nest different and conditions within or function...


easiest way it, have seperate functions in cell each , build step @ time, until you're sure it's right.. can paste function 1 cell if required.

say below in cells a1, a2, a3

=and(p2>=3,ad2=0) =and(p2>=2,ad2>=1) =and(p2>=1,ad2=2) 

then total formula in cell:

=if(or(a1,a2,a3),(h2+v2)/(p2+ad2),-999) 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -