Count of number of unique customers by month - excel

I have a spreadsheet that contains data for customers that have purchased items from my store. What I would like to do is go back the last couple years, using a pivot table, and display: number of customers that ordered something each month (a count of unique customer names).
The sheet is organized as such:
Date | Invoice | Account Name | Item | Quantity | Amount
6/1/2020 | 50100 | John's Tire Shop | 1/2 Inch Socket | 2 | 12.00
Is there a way inside pivot table options to count unique account names and display the total grouped by month?

You can create a helper column to identify unique values per month to add as a filter to your pivot using your existing setup
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1,"y","n")

I would propose you to add a helper column to your data, containing the =Month(A:A) function. But be careful: I see that your first date equals "6/1/2020", is that the first of June or is this Epiphany? :-)

Related

Max Value of a column in the same year and month

I have to columns I want to analyse, visits and dates. I now want the max visits of a month. The data ranges over multiple years.
+--------+--------+---+
|Date |Visits |Max|
|31.12.19|77 |77 |
|01.01.20|47 | |
|02.01.20|121 | |
|03.01.20|133 |133|
...
|01.02.20|21 | |
|02.02.20|135 |135|
+--------+--------+---+
You can create easily a Pivot Table:
More about Pivot
Tables
To create this Pivot Table I did:
Date field into Rows Section and grouped by Years and Months
Visits field into Values section and selected option MAX
Group Pivot Tables
Items

How do I negate a value in an Excel calculated field for a pivot table?

I've got a pivot table that has a sum of numbers aggregated per month per category. My data table looks like this:
Date | Description | Amount | Transaction Type | Category | Account Name
---------------------------------------------------------------------------------
12/16/2017 | Dinner | 150.00 | debit | Restaurants | CC
12/16/2017 | Return | 80.00 | credit | Restaurants | Cash
For the calculated field's formula, I've tried =IF('Transaction Type'="credit", -1*Amount, Amount) but it's just giving me the same sum of Amount. For this sum, I'd expect it to be 70.00 (150 - 80). Not sure what to do here.
You are after adding a calculated item rather than a calculated field as you are relying on the value of the field "Transaction Type" to determine the calculation result. See reference here
I assumed (oops) you meant credit - debit but, if not, simply swop the items around in the formula.
With your initial pivottable set up
With either Debit or Credit in the column headers of the pivot selected goto
Fields, Items, & Sets in the Analyze tab and selected Calculated Item
then add the following:
Name: Net
Formula: =' credit '-' debit '
Example layout final:
As noted in the link:
You will:
NOT be able to move the field to the Report Filters area
NOT be able to add multiple copies of a field to the Values area.
Extra items might be created in the pivot tables, such as cities
appearing in all regions, with zero values.

Pragmatically Get Count of Pivot Table Data

Suppose I have some sample data like so:
and I create a Pivot Table and order by Product > Sales Rep > Sales
If I want the # of sales John had for Product1 I would do =GETPIVOTDATA("Sales",$A$3,"Product","Product1","Sales Rep","John")
But how would I get a count of the entries there are. i.e. for Product1, John had 4 and Kevin had 2
Is it possible to get this count using GETPIVOTDATA()?
To get this you need to add another Sales field to the values section and change the "Summarize By" to Count. Then the formula will =GETPIVOTDATA("Count of Sales",$A$3,"Product","Product1") will get you the count of Product Overall.

PivotTable allows Skill filter and shows distribution of each Skill level

I have an Excel sheet set up basically with the first two columns as a person's name and their ID. Then the rest of the columns are title of a skill. The values of the table are basically the skill levels (0-4). So it looks like:
| Name | ID | Skill 1 | Skill 2|
| Jane | 01 | 3 | 4 |
I was wondering how I can use pivot tables to make it so that I have a column where I can I select in the dropdown the "Skill" and in that column would be 0, 1, 2, 3, 4 then the column next to it shows the Count of how many people put 0 for that skill etc.
Right now I have it like that but only one skill and if I wanted to change to a different skill, I have to manually change the pivot table row label. I was hoping to just change it within the pivot table itself.
I could rearrange the data to make this work but I'm having trouble conceptualizing how the data should be organized for this.
Is this doable in Excel?
Normally for pivot tables you want the data in a format more like this
Name ID Skill# Skill Value
Jane 01 1 3
Jane 01 2 4
Then you would be able to show what you want in the pivot table. You could then use report filters or column labels (with filters) to only show skill# 1 or skill#2.

Export records to excel sheet

I've got a table in access looking like this,
Category | Subcategory | Userdate (mm/dd/yyyy) | Color
I want to export this to an excel file where the Categories and Subcategories will be placed in column A and B respectively. However the Colors will be placed by month (Userdate), 12 months meaning Columns from C to N. So what I want to do is place the records from colors in different columns depending on the month (Userdate).
What is the best way to go about doing this? Create a recordset and loop through it? I reckon this will be a bit slow when rows exceed the 40k which is possible.
I could also make the table have Month columns like:
Category | Subcategory | January | February | etc...
So I could just export it just like that but seems to me that's just a bad way of making a table.
it sounds like you want a crosstab query:
TRANSFORM First(Table1.Colour) AS AColour
SELECT Table1.Category, Table1.Subcategory
FROM Table1
GROUP BY Table1.Category, Table1.Subcategory
PIVOT Format([Userdate],"mm-mmm");
You can transfer to Excel programmatically with DoCmd.TransferSpreadSheet

Resources