Excel charting data - excel

I'm having a hell of a time doing this...I want the vertical axis to represent how many times an ID appears and the horizontal to be the ID. So in essence the bar represents how often that ID appears in the column.
Any tips?
EDIT: for clarity...I have Column A loaded with IDs - might be 100 or more. I want a bar chart to show me how many times the ID has appeared. Just like below but with a bar going up to the # of times it appeared. I thought this was simple but charts don't seem to work this way. The IDs are going to be different so I don't think countif will work for this as that only works if you have a certain string.
Column A
ID1
ID2
ID4
ID3
ID1
ID4
ID8
ID4
ID5
ID6
ID7
ID1
ID8
ID8
ID1
ID9
ID8
ID10
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |______________________________________________________________
ID1 ID2 ID3 ID4 ID5 ID6 ID7 ID8 ID9 ID10

A PivotChart will do this quickly. To create one do the following:
Add a header to the column for the PivotTable to use
Put the cursor somewhere in your range of data
Go to "Insert" in the ribbon
Select PivotTable
Click OK
Add the field to both Rows and Values
Select the "Analyze" tab in the ribbon
Select PivotChart
Click OK
If the values are showing "Sum of" instead of "Count of", then do the following:
Double click on the header "Sum of [field]"
Change the selection to Count
Click OK

A quick solution: In the following image, I first put the distinct ID's in Column B, then in C1 I entered =COUNTIF($A$1:$A$18,B1), copied it down, then selected columns B, C and inserted a column chart:
The various chart elements can be clicked on and e.g. column width adjusted.

Related

Get pivot data & vlookup with multiple criteria

I have the following pivot table:
ID
Name
Ranking
123
Red
1
123
Black
2
123
White
3
124
Black
1
124
White
2
124
Red
3
Considering two conditions: ID&ranking I would like to look into the pivot table and retrieve the name. For example, for ID 123 & Ranking 2 I would like to see the name Black as result.
Any hint to write the formula in excel?
You can use a standard FILTER function and multiply the two criteria to get your filter list
=FILTER(B1:B7,(A1:A7=123)*(C1:C7=2))

Counting multiple values in a range to group by category and making a pivot table with slicer

I've been Googling at this for days and I can't seem to wrap my head around it and am not familiar enough to figure it out. I have a table of data. I have a list of categories with multiple codes for each category. Each row in my table has 100 columns than can have category codes in them. They can be blank or have different codes from the same category but no duplicate codes. Here is a small example
val1
val2
val3
val4
val5
val6
user1
3
5
3
6
4
7
user2
6
5
8
2
4
5
user3
7
7
5
3
7
0
user4
1
4
7
3
9
2
I am trying to make a pivot table to count the number of times codes are present for each category. Initially, I created additional columns in the data table, one for each category, that used COUNTIFs to look in all the columns per row and add up the categories. The additional columns look like this:
cat1
cat
cat3
user1
3
5
3
user2
6
5
8
user3
7
7
5
user4
1
4
7
So for example, if you count up all the codes belonging to cat1 for user1 (columns val1 - val100) it would be 3. The problem with this is when making my pivot table the columns are labeled "sum of" followed by category name, but more importantly, I can't make a slicer by category. I can make a slicer for one category and it lets me filter by the number of times the values appears in a row (0,1,2,3, etc).
I made another table with the codes in one column (unique) and the categories in another (not unique), but I just can't figure out how to get my pivot table working. I've been reading about adding a measure and using a DAX formula but I don't know if that's the right approach and I'm not familiar with them either. I need a pivot table because I eventually will turn it into a graph with slicers. Can anyone point me in the right direction?
Seems like your only Option is to Do the CountIF at the end of the table
or Reconstruct your source Table
Like
and then you pivot that like this
Lastly you can pivot that base on your second table
Your second Option is to

Column order in PowerView

I have following sample data in PowerPivot:
id name type color
1 aaa x blue
2 bbb y red
3 ccc x blue
4 ddd y orange
5 eee z black
When I create pivot table in Excel and enable show details (doubleclick on specific value), I get follwing output:
[$Sheet1].[id] [$Sheet1].[name] [$Sheet1].[type] [$Sheet1].[color]
1 aaa x blue
2 bbb y red
3 ccc x blue
4 ddd y orange
5 eee z black
What I'd like to set is my own column order or specify columns which I want to see. E.g.:
[$Sheet1].[id] [$Sheet1].[color]
1 blue
2 red
3 blue
4 orange
5 black
Could you please advise? Thanks
You need to merge the sort table with the main table, so the sorting numbers are inside the main table. Then you can click the Colour column and set the sort order to the sort column using the "Sort by Column" command on the Home ribbon of the Power Pivot window. In the screenshot, I have added the desired sort numbers
1 - red
2 - blue
3 - black
4 - orange
and added the values in a new column. Then defined the Sort by Column and created a pivot table where the color data is in the rows. Note how the desired sort order is applied correctly.
There are many different ways how you can get the sort numbers into the helper sort column.

Sort this data in excel kinda like a pivot

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:

Excel file - Keep the most recent for each ID

I have an excel file with this kind of data:
ID1 XXX YYY 22/11/1987
ID1 ZZZ AAA 23/11/1987
ID2 ZZZ AAA 23/11/1987
In that case, I would like to keep, for each ID (other fields might be differents), the most recent one, which would lead me with:
ID1 ZZZ AAA 23/11/1987
ID2 ZZZ AAA 23/11/1987
Thank you for your help
Assuming your data is in four columns (A:D) you might apply an array formula (CSE entry) such as:
=MAX(IF(A:A=A1,D:D))=D1
(although it would be preferable to restrict the number of rows to something manageable) in Row 1 and copied down to suit, to identify (by FALSE) rows to be deleted with Filter.

Resources