Excel - concatenating multiple rows into multiple columns - excel

The starting data set is the standard output generated from an online application that cannot be altered.
Date, Qty, Item, First Name, Last Name, Email, Comment, Timestamp, Phone, PhoneType
So if the same person orders 2 items (there are only 2 items available for people to choose from), it creates 2 rows, each with duplicate data other than the item and the quantity.
The output data set is desired to be on a new worksheet and sorted by last name, then first name.
Last Name, First Name, Email, Phone, Item 1 Qty, Item 2 Qty
Here is a file with sample input and output data. Sorry, can't post images until reputation >= 10.
https://www.dropbox.com/s/2ig3jdd9n7p2h9w/Example.xlsx
Any help is greatly appreciated, Excel is not my forte!

The simplest way should be a PIVOT table ...
Settings in Pivot Table Tools / Design
Subtotals: Do not show subtotals
Report Layout: Show in tabular form (to get names/1st names in seperate fields)
Report Layout: Repeat All Label Items (for displaying the 2nd Mr. Jones)
Settings in Pivot Table Tools / Options (if you want ... I did it but it's not strictly necessary)
Options / Display / Classic Pivot Table Layout

You can make a pivot table with Last Name, First Name, Email and Phone in the Row Fields, Item as a Column Field, and Qty as a Data field.

Related

How to make a dynamic list from a multi variable table with boolean values?

Please help, very stumped with this one.
I've been provided with a matrix table as seen in image attached. I have a list of users, as well as the courses that they need to be enrolled in.
I'm trying to create a list that will repeat the usernames for every course that they're enrolled in (in column A, and then a list of the courses they are enrolled in (column B)
So far, I've been able to create such a list by creating a pivot table from this data, double clicking the grand total, and sorting the results, but this is a very manual process, and it needs to be replicated by others.
Is that possible?
Google Drive link: https://drive.google.com/file/d/1zXsWZCguia-SLaYAP-81kMX819879zzX/view?usp=sharing
This is just something to get you started:
Convert your data to an Excel table
Steps:
In Excel:
Select the data range (starting from row 3)
Press Ctrl + T
Select Data | Get data from table
Transform your data in Power Query
In Power Query:
Select the columns headers (from FirstName to User)
Right click them
Select UnPivot other columns

Multiple columns in single row in Pivot Table

I have about 80k lines of flat data with fields as shown.
I am trying to create a pivot table that splits on Client, Department, Shift, Employee ID, first and last name, hours, weekending date.
I'd like the id#, last and first name, hour info and weekend date to all be on the same line.
Is that possible?
Design->Report Layout->Show in Tabular Form

Excel - De-cumulate data in pivot table

Hope you'll be able to help me.
I have a table with 11 columns, the first one is a date, the next 9 ones are a way of uniquely identifying data and the 11th is a certain amount of money.
What I'm doing in a pivot table is showing the added amount according to one of the identifiers (lines) and dates (columns).
All is well and quite easy to do in a pivot table. Today though I was told that the amounts in my source table are actually cumulative since the beginning of the year.
What I mean is that there are recurring entries in that table and that if I have an entry with the 9 identifiers in january and the same in february and march for example, the value of the one in february is actually (february-january) and for march (march-february).
I could through the unique identifiers just add a column in my source table to identify and calculate the real amount, but I was wondering if there was a way to do so in the pivot table directly ?
Thanks !
Edit :
Here is a screenshot of a simplified version (only two identifiers)
In the fourth column is the amount I have, and in the fifth the real one, that I have to calculate, it is quite easy with only two columns as identifiers.
The goal here is that the pivot table at the bottom shows the "real" amount without me having to create a new column in my source table.
My example table
You can do it using Calculated Items. But it is cumbersome.
A Calculated Item is just another item that a Pivot Table field can take. It is defined in terms of the other items in the same field. For example, the field Date might have values of Jan17, Feb17, etc. A new calculated item called Difference can be added to the Date field and defined as =Feb17-Jan17. This new Difference item will appear whenever the Date field is used to provide row or column labels and the values displayed for it in the main body of the pivot table will be equal to the corresponding values for Feb17 less those for Jan17.
The discussion below is based (loosely) on the pivot table in the picture accompanying the question.
Calculated Items cannot be calculated on grouped fields, so it will be necessary to ungroup the Date field in the pivot table. This will cause the items in the field to be displayed in the same dd/mm/yyyy format as the source data. Changing these to the custom format of mmmyy makes them easier to work with. In English (rather than French) they get displayed as Jan17, Feb17, etc. using this format.
To add a new Calculated Item to the Date field, select any item in this field and locate the Calculated Item option via the ribbon. This has changed across versions of Excel, in Excel 2010 it is accessed via the "Fields, Items & Sets" button of the "Pivot Table Tools/Options" tab of the ribbon. In later versions it accessed via the "Calculations" button of the same tab. A dialog box will appear as illustrated below.
In the Name: box insert a suitable name such as Feb17Xand in the Formula: box enter =IF(Feb17=0,0,Feb17-Jan17). Click "Add" then "OK". The new Date item labelled Feb17X will appear in the pivot table and will show values of 20, 0 and 0 against projects A, B and C respectively.
Feb17X is the decumulated Date item for February. The IF is necessary because although the Amountvalues are cumulative, they only appear in the source data whenever a new Amount occurs in the month (for example Project B and Department IS has data showing for April and June but not for May).
Similar decumulated Date items can be defined in the same way for the other months.
For March, Mar17X is defined as
=IF(Mar17=0,0,Mar17-(Jan17+Feb17X))
and a new Mar17X item is added to the Date field. Unfortunately, this shows values of -28, 0 and 0 against projects A, B and C, respectively. To get the correct values displayed, it is necessary to add the Department field to the row labels in the pivot table (below the Project field) and then to use the "Collapse Entire Field" operation to stop the detail of the Department field from being visible.
The calculated items for the remaining months are added as expected - that for June is Jun17X and has formula
=IF(Jun17=0,0,Jun17-(Jan17+Feb17X+Mar17X+Apr17X+May17X))
Once the new items have been defined for the Date field, a filter is applied in the pivot table to remove the cumulative items ie, Feb17, Mar17, Apr17, May17 and Jun17. This results in the pivot table displaying the sum of the decumulated values as shown below.
A few points:
The zeroes in the pivot table can be suppressed from display by setting the number format of the Amount field to #
In the larger problem where each Amount is defined by a Date, Project and 8 further field values, the row labels of the pivot table will need to include Project and all 8 of the attribute fields. The latter 8 fields will need to be "collapsed out" of the display.
It is much, much simpler to add a decumulated Amount column to the
source data range rather than using the Calculated Item approach set
out here. Sorting the source data by the 9 attributes (Project
first then the remaining 8) and then by Date makes the task
of decumulation very easy. Simply compare the 9 attributes in a row
with the previous row: if the values are unchanged between the two
rows, subtract the previous row's Amount from the current row's,
otherwise leave the current row's Amount unchanged.

Data in Rows Instead of Columns

The default List layout uses column headers with columns of data beneath them. This will not work for my report. I need to create an employee profile report that will return about 75 fields (job title, location, tax status, payroll deductions, etc.). This is a report that I want to be able to print on a single page for each employee. Using the The default List layout extends the data out in columns beyond the limits of a printed page, even in landscape.
How can I get my report to display in rows instead of columns, so that the field headers go from the top of the page to the bottom, with the data to the right of the headers. Even this will not be long enough to fit on a single page (that is easily readable), so I will need a second list to the right of the first. Like this:
Name: data Company: data
Location: data Employee Number: data
Job Title: data Date Hired: data
Thanks!
You can use a Repeater Table object to do what you want. This should be available in your toolbox. You group on the value you want to repeat on, likely an employee identifier in your case, and section on that value. That will produce one table per unique identifier value. In the table itself you can configure the number of rows and columns to fit the layout you want to produce and you are free to drag and drop objects from the model or query into the cells as needed.

Pivot tables without aggregation?

I have a list of items - each item has a title, plus a bunch of attributes, including a date.
If I drop the date into the row box of a pivot table, then group it, and drop the title below - so I have Years, Quarters, Created On, Title, I get a nice list of all the titles in my data, grouped by year, quarter and month.
But I want to also display all the other attributes next to the title of each one - all the associated data for each row. With the textural ones, I don't want to count them - I just want to list the entire data set, but grouped by date. If I add them to the other pivot table boxes it starts doing the usual counting...
It would be nice to have all the extra filtering power of pivot tables, but am I making this too hard?
Thanks for your help.
To display text data, you will need to use the data label feature.
Non pivotable text aggregation is easily accomplished in M code in power query One of my posts.

Resources