Irregular Range Average Based on Common Value in ID - excel

I'm trying to average groups of numbers which share a common value in one column but do not have a consistent number of rows. Simplified example of the problem below:
ID Value
Cat 2
Cat 3
Cat 5
Cat 8
Dog 1
Dog 6
Dog 3
Fish 3
Fish 9
So I'd like to find a single average of the values for each of the groups Cat, Dog, and Fish.
Note: I have just over 13,000 rows and 596 unique IDs shared amongst those 13,000 data (all positive decimals).

Select your data.
Go to Insert, Pivot Table
Select a destination for the Pivot Table
Drag the fields from the field list such that ID is a Row Label and Value is in the Values section:
Click on the downward arrow beside the Value field and click on Value field Settings.
Change the Summarise operation to Average.

Related

Custom sort in excel , by each account name and then by cost

I have an excel like
I want to sort the value by the Second column but
I want to retain the "yellow" colored rows containing total values as well after each sorting group, so the expected output will be BARBIE MEDICO first then the total sum of BARBIE, then RAJESH ..
When I tried Sort Box with Name and Then BY, all cost ( yellow) rows are coming on the top
Another example

Repeat label in a pivot table but add unique identifier

I'm trying to add a unique identifier in my pivot table.
Say you have this:
Apple 4
Orange 2
Apple 3
Orange 9
Banana 8
With item and quantity representing the labels respectively.
If you throw this in a pivot table and repeat labels, it would be re-arrange in alphabetical order (or really however you set it up). I want it to do this:
Apple-1 4
Apple-2 3
etc
Using the repeat item labels doesn't add this. Any ideas?
Sort your item list alphabetically
Create a new table, in the first column, use the following formula:
=A2 & "-" & COUNTIF(A$2:A2,A2)
In the second one, siomply use =B2
Populate down

Fill in table based a column of categories in Excel

I have a table that looks like this:
Type Value
Movie 5
Food 3
Gas 10
Food 2
.... ....
And There's a second table I want to fill in with "Value" based on their type in the first table, so that the corresponding rows look like this:
Rent Food Movie Gas Clothing ... ( appear in specific order bc they are subcategories)
5
3
10
2
The title row is already there, so I was thinking there might be some kind of lookup method to do this? How do I do that?
your second table apperas to hold one value per row but it doesn't have a label. it does correlate to the original row number, is this by design or coincidence?
if this is by design then you can use those 2 columns, hide them if you like, get a unique list of categories by copying you r abels to a new colum, removing duplicates in the data tab, then paste special transpose in c1 to create colum headers.
so column a and b remain unchanged
row 1 contains header starting at column c
your data starts at c2
this is the formula
=Iferror(vlookup(C$1,$A2:$B2,2,false),"")
drag it down and to the right
you can copy paste special values when done to remove the formulas
for something with only a hundred or thousand cells this will be one of the easier options but i would not do this on large tables, for those i would use power query or VBA
Assuming your 1st table is in Sheet1 and 2nd table is in sheet2.. you may try to fill in Sheet2!A2
=IF(Sheet1!$A2=A$1,Sheet1!$B2,"")
and drag it all the way.. Hope you get how it works.. and what you need.

Filter excel pivot table by complex combination of several fields

Let's assume I have an excel table with at least 3 columns, "Text1", "Text2" and "Number". Text1 and Text2 obviously contain textual content and Number is a numerical value. I create a pivot table from this table with Text1, Number and Text2 in the rows (in this order). I do already group my results by ranges of Number.
I would like to filter my pivot table so that I only include results, that share a value of Text1 with at least one other entry, while also being the same range of Number and while having a different value for Text2 than the other entry (the one they share Text1 with).
Is this possible? I don't mind adding additional fields to the original data table for calculations if necessary.
Example
Let's say I have a table that contains the fields FirstName, Sex and Age like this:
FirstName Age Sex
Kim 19 Female
Kim 57 Female
Kim 20 Male
Tom 23 Male
I group my ages by steps of 25, so 0-24, 25-49 and so on. In this case I would like to only find all the Kims in the same age range that have a different sex.
Thanks to Ilia's comment, I was able to find a solution. I needed three additional columns in my table:
Concat: The concatenation of my Text1 and Text2 field
Group: A field that calculates the groups of my Number field (using QUOTIENT)
Count: This field uses COUNTIFS to count my fields if there are other matches in the Concat column that have the same value as this has in the Concat column and the same for my Group column.
I am now able to use my Count column as a row in the pivot table (below Text2) and add a label filter to check if the value is greater or equal to 2.

Sum and count values by group where group name shows once per group

Just had a post here, solved a simple question. Here is one more question.
How can I SUM all values for each Item if they are not on the same rows as their item's description? See Total Value:
This is in several elements:
1 Convert your strings in ColumnB into values (select all green triangles, click on exclamation mark and on Convert to Number).
2 Fill down (as in comment above)
3 Pivot Table:

Resources