Functions for determining material number and group