Sum() and Count() are aggregate functions (they work on groups of values--usually from groups of records). I'd recommend looking up aggregate functions in your on-line help to better understand how they work.
You should be able to pull together the count you need with either a summary field (Possibly in conjunction with the GetSummary function or the count function.
If you use an aggregate function to work with values from the same field, but from multiple records, it should have the format: Count(TableOccurrenceName::FieldName). By specifying a table occurrence, to tell filemaker which group of records to refer to via the relationships you've created in your relationship graph. Thus, if your layout's specified table is "Company" and you have a link from Company to your "Employee" table, Count(Employee::EmpID) will return the count of all related employee records where EmpID is not empty.
Hope that helps.