I have a sheet for my classes, containing a seating chart and a list of student names. With data sorting I am able to generate quickly a new random seating chart, but I would like to also do this based on gender, in an alternating way (boy - girl). The standard option to sort based on gender gives me the student names sorted with all the girls (F) first and then all the boys (M). Can someone help me create a formula or script for this? For reference; column "U" is Student Name, column "V" is Gender (F or M)
File: the Seating Chart