unique records by team

juster21

Well-known Member
Joined
Jun 3, 2005
Messages
867
All,
I have a table with team names, employee ID, month/year combos and a quality score.
I need to calculate the total count of employees that have a quality score within a specified timeframe (March 2009) and have the results by team name.

See example:
Team EmpID MonthYear Quality
A.......1.......March2009.....99
A.......2.......March2009.....98
A.......3.......March2009
A.......4.......March2009.....100

B.......5.......March2009.....100
B.......6.......March2009.....99
B.......7.......March2009

Results:
A = 3
B = 2
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Code:
select
Team, count(*)
from your_table
where
(
  (  
    [Year] = 2009
  )
  and
  ( 
    [Month] = 'March'
  )
  and 
  (
    Quality is not null
  )
)
group by 
Team
 
Upvote 0
MonthYear is one column ?
what's in the Quality column is there is no Quality ?
null ? 0 ?

this works for me if Quality is null when no Quality is entered
Code:
select
Team, count(*)
from your_table
where
(
  (  
    MonthYear = 'March2009'
  )
  and 
  (
    Quality is not null
  )
)
group by 
Team
 
Upvote 0

Forum statistics

Threads
1,222,014
Messages
6,163,392
Members
451,834
Latest member
tomtownson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top