Count of unique values based on another column's unique values

Ace71425

Board Regular
Joined
Apr 20, 2015
Messages
130
So my brain is fried for the day...here's what i'm trying to do...I have a table that has columns that are...

Rep, Action, Date
John Call 10/20/2015
Billy Call 10/21/2015
Jane Call 10/20/2015
Jane Email 10/21/2015
Jane Call 10/20/2015
Billy Email 10/19/2015

I would like this sorted with a query so that it shows the rep's name, the action taken, the date, and the count of action taken by date essentially so it would look something like below.

Rep, Date, Action, Count
John 10/20/2015 Call 1
Billy 10/19/2015 Email 1
Billy 10/21/2015 Call 1
Jane 10/20/2015 Call 2
Jane 10/21/2015 Email 1

So now the query would show the count of what everybody did on each day, IE Jane made 2 calls on 10/20/2015. Thus the title of the question count of unique values (Actions) based on the unique values of (Date). Maybe that's not the best way to phrase it but you get the picture.

Let me know if this isn't clear enough. As always I greatly appreciate it!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Simply make this an Aggregate (Totals) Query.
- Add those three fields two your query, and then add any one of this field again (so you have a fourth field).
- Click on the "Totals" icon (looks like a Sigma).
- Under the 4th field, on the Totals row, change the "Group By" value to "Count".
- View your results.
 
Upvote 0
Create a query based on the table containing your data, say "yourTable". After adding yourTable in design view click SQL view and paste the following SQL code.
Code:
SELECT yourTable.Rep, yourTable.Action, yourTable.Date, Count(yourTable.Action) AS CountOfAction
FROM yourTable
GROUP BY yourTable.Rep, yourTable.Action, yourTable.Date
ORDER BY yourTable.Rep;

Then go back to query design view to check and learn how it should have been designed in design view.
 
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

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