Y at the BEGINNING of a syllable marks a consonant sound (and so may be called a consonant) examples: you yellow yak
Y elsewhere in a syllable (middle or end) represents a vowel sound (and so is called a vowel). examples -- the many words with a -y ending/suffix: happy, funny...