Preparing Excel Pivot Table - excel

-
I have a tabular data with values as in picture. I created a pivot table in excel 2007 .How can I get count value of each up/Down for date specified. I tried to by making one column row and other as values but it would not work.
The result would be:

A better solution is to use a countif function on a second tab. something like
=COUNTIF(Sheet1!A:A,"UP")
and
=COUNTIF(Sheet1!A:A,"DOWN")
and copy it across the range of dates.
If you can format your data differently to look like this
Then the pivot table becomes easy withthe following settings

Related

Excel - How to look up data in a pivot table and use the values in the next cell?

I have a Pivot table like this
I try to convert this to a user table with all names and have the data listed by day
I tried to use VLookup bus not being succesfull in separating the code in a column structure.
Apologies for the pictures I tried to add a table structure but it didn't work out.
Any suggestions please?
My approach is to isolate regions based on the date you provide, then vlookup on that area, here is the formula, you can try:
C18==IFERROR(VLOOKUP($B18,INDEX($B$3:$B$15,MATCH(C$17,$B$3:$B$15,0)):INDEX($C$3:$C$15,IFERROR(MATCH(D$17,$B$3:$B$15,0),13)),2,0),"")

Get slicer selection of a data table

I have been struggling with this issue in the past days and haven't found yet any solution.
I have a simple table (not a pivot table) and some slicers attached to it. I want to 'simply' show selected value/values of the slicer in a cell. It implies of course to make the cell update automatically according to the selection.
Some of the solutions I found suggested using two pivot tables, one main for the regular data and the other hidden to capture the selected filters. The problem is that I am not working with a pivot table, but rather a simple table.
I also tried getting distinct values of the table column, but I couldn't perform it properly without getting the hidden values of the filtered table too.
Is there any way in Excel to do this simply?
Thank you!
You can follow the below steps to achieve your result
You will have to insert a serial number column in your table
After that insert the below formula above the header or anywhere you want to display the selected value
The formula in C2 is
=INDEX(Table1[Data 2],SUBTOTAL(5,Table1[S.No]))

Add column to Excel Power Pivot Table based on slicer seection

I have an Excel Power Pivot Data Model with one table of about 3m entries. In one of my sheets I have multiple slicers that I combine to select entries that fit specific criteria.
I would like to add a column with a value that comes from a cell in the sheet, but only when the entry was part of the selection. For example: when the value in the cell is 1, the selected entries will get "1" in the added column. After that the number in the cell could be set to 2 and a new selection could be made. The new selection will all have "2" in the same added column.
I have been trying to make this work running a macro and DAX, but it can't get it to work. Anyone any ideas?
You can use the VBA I've previously posted at Converting multiple variables into values with excel pivot tables or power pivot to do that. It requires you to make up a 'harvester' PivotTable containing just the columns you want to swap out, so that you can then create a slicer from which to trigger the code.
You can also write a conditional formula in DAX that uses a harvester measure. Something like https://powerpivotpro.com/2012/11/one-slicer-to-control-them-all/ (and plenty of other examples on Google)

Excel: transpose rows to columns and merge

I would like to present some data in Excel in a table. I have a sheet with three columns: date, time_spent and user_id. Every row is a data record. I want a table with a column for every date and every value with time spent below the date.
Using the transpose function under paste special I get this:
However I would like only one column per unique date, so the amount of columns decrease like this:
Does someone know how to do this?\
I have more than 10000 rows, so manually is too much effort...
Using Pivot Tables as Tim Biegeleisen suggested I cannot get what I want either, I'm not an expierenced user of Pivot Tables so probably I'm doing something wrong:
Excel file as shown in above picture
Here is one way of using a Pivot Table as suggested by Tim above in the comments, but you must use it on your original, non-transposed data: (and note which parameters go to which areas.
A disadvantage of the Pivot table is that the column headers are text strings and not dates. If your version of Excel is 2010+, you can use Power Pivot or Get and Transform to do a better job:
Open the Query Editor, change the format of the Date column, and Pivot the column:
Then Save the results:
Advanced filter dates to unique values in a new column
Copy and transpose them to make your column titles
Insert a new column B with the formula =TEXT(A2,"yyyyddmmm")&COUNTIF($A$2:A2,A2) and fill down
Below your new column headers put in the formula =IFERROR(VLOOKUP(TEXT(H$1,"yyyyddmmm")&ROW()-1,$B$2:$C$8,2,FALSE),"") and fill down and across. You will need to fill it down to cover the maximum number of instances of each date.
Adding a sumif to this table and your initial table would be a good way to check you got everything.

Excel Pivot Table - How to retrieve value of cell in Rows section

I have some raw data as shown below.
I created a Pivot Table for it, mainly just for formatting purposes (the ability to nicely group and expand the sub-items). The Pivot Table is shown below.
I need to display the LastUsageTime for each of the items (UsageName) listed in the Pivot Table. It is simply a lookup of the LastUsageTime column from the Raw Data.
From my research so far, it looks like I have to use Index+Match to do the lookup to match all 3 columns (TPC, TeamProjectName, UsageName). Something like:
{=INDEX('Raw Data'!A2:E2000,MATCH(1,('Raw Data'!A2:A2000=???????)*('Raw Data'!B2:B2000=??????)*('Raw Data'!C2:C2000=A6),0),5)}
However, I don't know what to use to retrieve the TPC and TeamProjectName of each UsageName in the Pivot Table.
I hope this makes sense, and thanks for any help!
For the sake of an answer:
Process your LastUsedTime data into what is recognised by Excel as Date/Time and then add a field to your PivotTable for Σ VALUES Max of LastUsageTime (or Max of ... whatever the column of adjusted LastUsageTime data is labelled).

Resources