# calculation using case function

Question asked by dogkahlua on Dec 7, 2017
Latest reply on Dec 14, 2017 by dogkahlua

I am having difficulties creating a calculation using case.  Perhaps I am making more complicated than needed and perhaps it needs to be an If function. Not quite sure.

I work with students in college.  I am trying to create a blurb for my report.

Example of blub:  Mary Margaret '18, a senior in the College of Engineering, is majoring in Computer Science and Economics.  Mary can be reached at mm54@cornell.edu.

Issue:  Students have more than one college and possibly more than one sub school.

Fields:

college (essentially college 1)

sub school

college 2

sub school 2

College_Sub School One Concat - calculation that combines the College  and sub school

College_Sub School Two Concat -- calculation that combines the College 2 and sub school

Problem: The Case function below is almost perfect...I just cant seem to get it to come out right when I have a student that has only two colleges but no sub schools.

Blurb should read:  Mary Margaret '18, a senior in the College of Engineering and College of Arts and Sciences, is majoring in Computer Science and Economics.  Mary can be reached at mm54@cornell.edu.

Where is my error???

Here is my case "statement"

Case (College ≥ "a" & School_sub = "" & CollegeTwo ≥ "a" & School_sub2 = ""

; College & " and " & CollegeTwo

;College_Sub School One Concat = College_Sub School Two Concat

; College_Sub School One Concat

; College_Sub School One Concat ≠ CollegeTwo

; College_Sub School One Concat & " and" & CollegeTwo

; School_sub   ≥ "a"

; College & ", " & School_sub

; CollegeTwo  ≥ "a"

; College & School_sub & " and " & CollegeTwo & School_sub2

; College )

Thank you!