excel - NESTED IF AND formula problems -


i need formula can tests multiple logical conditions , give answers based on criteria.

for example if e12=first , g=12= above 40 result should k8

so used formula if(and(e2= first ,g2= above 40 ),k8)

and works first , above 40 cells changeable

a.first-above 40 =k8 b.first-below 40 =k9 c.second-above 40 =k10 d.second-below 40 =k11 e.third-above 40 =k12 f.third-below 40 =k13 

i think need nested if , formula cant quite figure out.

[picture of sample data]

=if(e2="first",if(g2="above 40",k8,k9),if(e2="second",if(g2="above 40",k10,k11),if(g2="above 40",k12,k13))) 

now described above (or @ least should). while entering made couple of important assumptions. e2 ever have first, second or third in it. if statement above checks first or second , entry not 2 assumed third. next g2 either above 40 or below 40. can never equal 40. value not above 40 return value below 40.

there ways fix of potential pitfalls did not want spoon feed everything.

you may want @ adding if statement in front of make displayed results equal nothing if there no entry in e2 or g2.

edit

description of happening if statement. think of if statement follows:

if(some sort of true false check,  true action, false action) 

so in case true false check happening cell e2. cell e2 equal word first (also referred string). formula looks like

if (e2="first", first's true action, first's false action) 

you got part on own. figure out going if true. in case want check g2 , see if equal string above 40. have our first nested if.

if (e2="first", if(g2="above 40", first's above true action, first's above false action), first's false action) 

so using of assumptions made based on description, option g2 if not above 40 below 40. such not need make check if statement g2 might be. can if not above 40 check false meaning below 40 , can return false results. in case boild down following first nest:

if (e2="first", if(g2="above 40", k8, k9), first's false action) 

so know happens long e2 equal "first". need figure out happens e2 when equal else. wind next iteration.

if (e2="first", if(g2="above 40", k8, k9), if (e2="second", second's true action, second's false action)) 

and need check second above/below did , wind with:

if (e2="first", if(g2="above 40", k8, k9), if (e2="second", if(g2="above 40", k10, k11), second's false action)) 

we keep building checks in e2 dropping check false action section. in case know there 3 possible values. if e2 not equal first, , when check , find not equal second, definition of problem has euql 3rd , not bother checking this. need check if above or below 40 wind formula @ top.


Comments