Filter BuddyPress Users by Profile Field?

Is there anyone that has had success with modifying the member loop to show only a set of users filtered by a specific profile field?

For example, we are creating a user directory, but it would be nice to categorize the users by a profile field which we set with a drop-down item. So if we have “teachers” and “students” I’d like to show only one or the other in the member list and then an option for “all”.

Plugin or PHP code is fine with me :slight_smile: