How to analyse change in time in Excel? - excel

I have following data in Excel:
Name, Status, Date
Name is name of Book and combination Name, Date is unique.
Status is one of 4 possible statuses
In stock
Ordered
Rented
Missing
Date is date of entry
Data are entered every week and they like this:
Name, Status, Date
ABCD, In Stock, 1/1/2017
BCDE, Ordered, 1/1/2017
CDEF, Rented, 1/1/2017
DEFG, Rented, 1/1/2017
ABCD, In Stock, 10/1/2017
BCDE, In Stock, 10/1/2017
CDEF, In Stock, 10/1/2017
ABCD, IN Stock, 20/1/2017
BCDE, Rented, 20/1/2017
CDEF, Rented, 20/1/2017
EFGH, Ordered, 20/1/2017
What I need to find are few thinks:
how many entries were added each date and how many removed?
which books have same status for all Dates (or selected dates using slicer)
Is it possible to do such things using pivots? Or do I need different tool?

You can put pivot tables:
1. For book status by date Columns: Status, Rows: Date, Values: Count of Name
For Unique Status all dates: Columns: Name, Rows: Date, Values Count of Status.
Then you can just look at the sum for each column - which ever has 1 - thats the book you are looking for.
Hope it helps.

Related

Count of number of unique customers by month

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? :-)

Get name from only date and ID matched with people list

I have rawdata with only ID's and dates of transactions. Then I have a list of people; their ID, their hire date and their name.
What I want is a column in the rawdata that gives me the persons name. The problem is, that the ID is re-used if the person quits, and another one starts.
Since I have the transaction date, I figure it should be possible to check:
IF the transaction matches the period they were hired, then get the right name.
Is this possible, and then how?
Rawdata:
Column A = Transaction date
Column B = ID
Column C = Here I want their name
People list:
Column A = ID
Column B = Name
Column C = Hire date
Example (Excel Online - can be edited):
https://1drv.ms/x/s!AjWVkb2UBexjhzAKMy-YiE5EoKwc
Screenshot:
Make sure your reference table is ordered in chronological order oldest to newest:
=INDEX(F:F,AGGREGATE(14,6,ROW($G$8:INDEX(G:G,MATCH(1E+99,E:E)))/(($E$8:INDEX(E:E,MATCH(1E+99,E:E))=B8)*($G$8:INDEX(G:G,MATCH(1E+99,E:E))<A8)),1))
I had to name your tables People and Raw_Data to use structured table references in the formula. Additonally, I added some data and changed a few dates.
=INDEX(People[Agent Name], AGGREGATE(15,6, (ROW(People[Personal ID])-ROW(People[[#Headers],[Agent Name]]))/((People[Personal ID]=[#[Personal ID]])*(People[Hire date]=AGGREGATE(14, 6, (People[Hire date])/((People[Personal ID]=[#[Personal ID]])*(People[Hire date]<=[#[Transaction date]])), 1))), 1))

Count Index based on Multiple Conditions - Excel

I have a table with order records for each Product Type. The columns contain information like Order Number, Customer Name, Product Category, Product, and Order Receipt Date.
My goal is to find the quantity of orders that fall into the below conditions:
New Customers Ordering any Product Category for the First Time
Existing Customers Ordering from any Product Category for the First Time
Reorders from any Product Category
What would be the best way to go about this?
Think I figured it out:
I created two columns for records: "First Product Type Order?" and "First Order?"
"First_Product_Type_Order": IF(AND(Order2=Order1,Product_Type2=Product_Type1),First_Product_Type_Order1,IF(SUMPRODUCT(($Customer$2:$Customer2=D2)*($Product_Type$2:$Product_Type2=Product_Type2))>1,"Reorder","First Time Order"))
"First_Order":
IF(Order2=Order1,First_Order1,IF(SUMPRODUCT(($Customer$2:$Customer2=Customer2)*1)>1,"Existing Customer","New Customer"))

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.

SQL Server Reporting Services. Calculate the total value in a cell when the row is grouped in gender

I have a table in my SSRS report with grouped rows for gender and one row has total values. So my table in short looks like this:
NumOfGenders %Gender Total Salaries GenderSalaries in %
Female countRows () ? [Sum][Salaries] ?
Male CountRows () ? [Sum][Salaries] ?
Total CountRows () ? [Sum][Salaries] ?
I donĀ“t figure out to get the expressions to count for the number of both genders in % and Total salaries in % for both genders.
I want % gender to be for example female (countRows for female)/(count rows for the whole set)*100. So I get the share of female and male in the table. For The total Salaries I want the female share of the total Salaries to be salaries for (female)/(Total salaries)*100. The expression in the rows for salaries is:
=Sum(Fields!Salaries.value)
So I want something like this:
=(Sum(Fields!Salaries.value "females")/(Sum(Fields!Salaries.value "Total")*100
So how do I get the genders specifik values in the expressions?
I assume your table is having a group as "Gender" and you are having a sub-total field to calculate total. Say you are pulling these data from a Dataset named as ds_dataset.
In this case you can put below expression in your gender % field.
=(Sum(Fields!gender.value)*100)/Sum(Fields!gender.value,"ds_dataset")
Here the "ds_dataset" is your dataset name.
For salary % similarly you can put below code.
=(Sum(Fields!Salaries.value)*100)/Sum(Fields!Salaries.value,"ds_dataset")
Let me know if this is not clear.

Resources