Hi Luke, can you use the (Count distinct) to get only one count.
Please attach the workbook.
As Sankar suggested, you need the Count Distinct function - COUNTD()
An example is below, this deals specifically with each Gender (you could also total Male and Female separately)
IF [Gender]='M' THEN COUNTD([Student No])
ELSEIF [Gender]='F' THEN COUNTD([Student No])
ELSE NULL END
note - I haven't tried the formula but I think it should work...
if you get stuck, post back and please provide an example workbook