If it helps explain it better, let's redraw the example. With the Big Class sample, I want a new column that it will compare all the female F heights individually to KATIE's height, and all the male M heights to JOHN's height. This new column would be called "height difference", and each row would have that person's height minus KATIE or JOHN's height depending on M/F. So rows 2, 3, 4 with LOUISE, JANE, and JACLYN will have "height difference" values of 2, -4, and 5 respectivly. (Negative number are acceptable). However, when it comes to TIM, his height will be compared to JOHN's 65 not KATIE's 59.
Taking it one step further, what if I wanted this done for every name on the list besides the ones who's age = 14. All the rows where age != 14 will still have their respective "height difference" compared to KATIE and JOHN. For those of age 14 I would like the cell to be blank.
Hopefully this clears things up, and gives an example to work on as opposed to just taking about it. If it makes it more confusing then completely ignore it :)