excel - How can I use structured references to identify column and use row values in the identified column as criteria? -


i have excel 2013 table, called 'student_courses' columns: stu_id, stu_major, stu_course, , calculated column named validated_crs.

i trying create formula calculated column named validated_crs evaluates every record.

in calculated column, need reference value in stu_major column find column in second table, 'qualified_courses'. headers in 'qualified_courses' table correlate stu_major values.

i need check see if of values in correlated column in 'qualified_courses' match 'stu_course' value in record being evaluated in 'student_courses' table.

if of values in correlated column match stu_course value given record in first table, should return value of "validated" in calculated column.

so far, have found out how return second table column values using =indirect("qualified_courses"&"["&[@[stu_major]]&"]"), i'm not sure how use returned set of values check against stu_course value see if there match.

many thanks,

lindsay

student_courses table:

stu_id     stu_major     stu_course     validated_crs 5432       multe         biol1102       validated 5432       multe         musc1303       null 5432       multe         engl2303       validated 6737       multm         hist1104       validated 6737       multm         biol1222       null 6737       multm         educ2303       validated 6737       multm         educ1302       validated 

qualified_courses table:

multa      multb         multe          multm art1301    hist1301      biol1102       hist1104 biol1322   pols2210      engl2303       educ2303 engl1440   is3340        art3303        educ1302            biol2302      biol1222       musc1303 

this formula builds on yours:

=if(isnumber(match([@[stu_course]],indirect("qualified_courses"&"["&[@[stu_major]]&"]"),0)),"validated","") 

we use match function search returned column course. if there 1 returns number, otherwise error.

the isnumber returns true/false if uses determine outcome.

but not indirect() formula volatile formula. prefer index formula:

=if(isnumber(match([@[stu_course]],index(qualified_courses,0,match([@[stu_major]],qualified_courses[#headers],0)),0)),"validated","") 

which return same.

instead of indirect find correct column use index/match. once again match returns number, time of column in second table.

the index() uses nubmer return full column @ position. 0 @ second criterion states want full column.

then first.

volatile formulas recalculate every time excel recalculates whether data tied changed or not.

non volatile formulas recalculate if data refer changes.

the validated_cs column in picture top formula , next column bottom:

enter image description here


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -