Sort this data in excel kinda like a pivot - excel

All,
I have this data I pulled from a database that I need to readjust. Here it is:
ID | Type | total
1 Purchase 12
1 Return 2
1 Exchange 5
3 Purchase 34
3 Return 4
3 Exchange 2
The desired result is:
ID | Purchase | Return | Exchange
1 12 2 5
3 34 4 2
and so on with a lot more data. Can this be done?

In Excel, format the data like so:
Choose a cell in these data, go to Insert -> PivotTable, insert it where you would like, and use the following settings:
This gives
Under "Design" in the Ribbon (make sure that your PivotTable is selected), go to Grand Totals -> Off for Rows and Columns. This gives
Click the "Exchange" cell and go toward the top of it, right below the "Column Labels" cell - you will see that the arrowhead will change and you can drag the column:

Related

Distinct Values based on two columns in Excel

I must be tired because I feel like I've done this before, but just banging my head tonight.
Anyway, I have a data sheet. 10 columns 800 rows. ( an excel table if you will)
On a separate sheet I have various drop downs. I want to be able to have a drop down that is based on the first 2 selections the user makes.
So If in cell A2 user selects 10 and in cell B2 user selects 12 , I want to be able to filter the excel table for values in Column D, based on the 2 values selected beforehand.
I've looked at formulas and doing data validation. I'm using the data validation for cells A2 and B2, however they are just list.
I tried a 3rd data validation using an If statement, but that continues to fail.
datasheet could contain:
column1 |column2 | column3|etc...
10 | 12 | 22
11 | 13 | 23
11 | 33 | 23
10 | 12 | 25
11 | 13 | 24
10 | 12 | 26
What I think should work, something like:
if(A2=10, list1, list2)
My issue is list 1 is where I need to select distinct values from column 3 based on filtering items from columns 1 & 2, but I cant get it to work to save my life...
When I try to do the formulas as listed above, it barfs telling me I need a delimited list...
Just looking for pointers in the right direction. Like I said , I feel like I've done this before, just can't recall it tonight. Thanks in advance for any direction. Respectfully.

Getting unique values in excel from table with multiple equivalent values

I am not an excel expert, but I have been searching for days on a method to repeatably pull non-zero entries from a 2 column table. The reason it has to be repeatable (and hence can't use filtering) is that I have about 50 pie charts with different data sets I need to create so that the charts only have slices that are greater than zero.
Here is an example of the source data, which I have pulled from a few thousand rows of raw entries
| Possession type observed | Count |
| ------------------------------|--------
|Handheld device 27
|Backback 53
|Baby stroller 5
|Walking aid 1
|Headphones 5
|Wheelchair or mobility device 2
|umbrella 1
|Bundle buggy 0
|book 0
|DVD 1
|purse & holding keys 0
|handbag 1
|clutch wallet 0
|white paper 0
|grocery bag 0
|purse 0
|holding newspaper 0
|None of these 83
I haven't found a satisfactory solution to build a pie chart out of the data above that removes zeros, so I went ahead and tried to create a summary chart only listing values > zero.
But my problem is that I can pull non-zero entries out, when it comes to the entries with the same value (e.g baby stroller and headphones both have a value of 5), I can't grab baby stroller, then headphones.
Ideally I would like the summary chart to look like this:
| Possession type observed | Count |
| ------------------------------|--------
|Handheld device 27
|Backback 53
|Baby stroller 5
|Walking aid 1
|Headphones 5
|Wheelchair or mobility device 2
|umbrella 1
|DVD 1
|handbag 1
|None of these 83
Thanks so much in advance for any assistance!
To get the desired output follow these steps:
Step1: Select the data
Step2: Choose pivot chart from insert tab,follow the wizard to create the pivot table and chart where you want them or hit Alt + D + P and 3 times enter
Step3: Change the chart type to pie from the Design tab
Step4: Drag the 'Possession type observed' field to the 'Axis' area
Step5: Drag the 'Count' field to the 'value' area as well as 'report filter' area
Step6: Filter out 0 using the dropdown on the chart

I want to get the sum of count of each unique entry from a particular column from google sheet

I have a google spread sheet,I want to get the sum of count of each unique entry from a particular column('Text' in this example).However the entries in the column themselves repeat.
Eg:
Text Count
a 3
b 4
a 8
abd 4
c 1
t 2
abd 5
a 2
v 1
v 67
w 44
I want the output as:
Text Count
a 13
b 4
abd 9
c 1
t 2
v 68
w 44
Under the assumption that you want to get the results in the text column automatically, use a Pivot table in Excel:
Mark your data including the column captions "Text" and "Count"
Go to the "Insert" tab in the ribbon, hit the arrow below and choose "PivotChart and PivotTable"
The cells for the raw data should already be entered. In the lower part of the window choose where you want to get the Pivot table. Then hit Ok.
There should be an area on the right-hand side of the window where you can choose which data you want to evaluate. Choose Text and Count.
There should already be the sum of the Count values. If you want to get a different quantity such as the average, hit "Sum of Count" with the right mouse button and
You need a GROUP BY and a SUM:
SELECT text, sum(count) as count
FROM yourtable
GROUP BY text

DAX for MAX of a group

I have two data columns:
Record | Record Version
------------------------
1 | 1
1 | 2
1 | 3
2 | 1
2 | 2
2 | 3
2 | 4
3 | 1
3 | 2
3 | 3
4 | 1
4 | 2
4 | 3
4 | 4
4 | 5
4 | 6
5 | 1
6 | 1
Is it possible to create a calculated column within a MVS-2012 model or PowerPivot that will give the MAX of the Record Version for a corresponding Record? For example the MAX value of Record 1 is 3, MAX value of Record 2 is 4 etc.
Yes. Add that table to your Power Pivot model, either by pasting the data into Excel and then clicking Add to Data Model on the Power Pivot ribbon, or by opening the Power Pivot Window and adding it form it's original source there.
In the Power Pivot window, go to the table where this data is located.
Select the Record Version column, then click the drop-down next to AutoSum in the Calculations group on the Home tab and choose Max.
A calculated column will appear at the bottom. YOu can rename it to something like Max Record Version.
Make a PivotTable in Excel (click the PivotTable button on the Home tab).
Add the Record field to rows and the Max Record Version to values.
If you actually want a calculation that will give you the max for the group of record you could do something like:
=SUMX(VALUES(Table1[Record])
,CALCULATE(MAX(Table1[Record Version]))
)
Generally, as #mmarie suggests, you are better dealing with this kind of problem with a measure rather than a calculated column. That said, sometimes you just need that extra column (usually to use as a dimension).
Assuming you have a table called recordsFact, this gives the MAX of that record:
= CALCULATE(MAX(recordsFact[Record Version]),
FILTER(recordsFact, recordsFact[Record] = EARLIER(recordsFact[Record])
))

Excel: filter table rows by specified column value

I have a table with first column as primary key. Ex:
id value1 value2
1 10 5
2 2 3
3 12 5
..
I also have a second list of id's I want to select, which can have repeated ids. Ex:
selectId
1
2
2
2
5
10
..
How can I "merge" the two tables (something like INNER JOIN) to obtain:
id value1 value2
1 10 5
2 2 3
2 2 3
2 2 3
5 99 99
10 22 22
..
I tried using 'Microsoft Query' from Data > Extern Data to join the two tables. The problem is that it seems it cannot handle tables with more than 256 columns.
Thanks
UPDATE:
Thanks, VLOOKUP works as intended.
However one problem is that if the row was found but that corresponding column was blank, this function returns 0 (where I expected it to return an empty cell), and since zero is a valid value, I have no way to differentiate between the two (blank and zero)?
Any help is appreciated..
If this is Excel -like the title says- just use vlookups.
Not very relational, but that's the Excel way.
Using the VLOOKUP function would get you the data in the layout you require.
If you are using Tables in Excel 2007, the formula would look like this based on the example below.
in cell B8
=VLOOKUP([selectId],Table1,2,FALSE)
in cell C8
=VLOOKUP([selectId],Table1,3,FALSE)
Lookup screenshot http://img208.imageshack.us/img208/1/lookupz.png
It is not clear where you store your data, but it looks like you have this problem, described on Microsoft site:
http://support.microsoft.com/kb/272729

Resources