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

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:

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

How to print top 3 employees in a region in excel?

I have a table with three columns, region, emp_name, salaries.
I want to add one more column to this table in excel.
That new column should have either 1 or 0. 1 indicates one of the top3 employee based on salaries in a particular region.
For example, Region1 has 7 employees, namely emp1, emp2, so on emp7. emp2, emp4, emp7 have top 3 salaries.
So in the new column, emp2, emp4, emp7 must have 1 and others have 0. Let's say this table contains n number of regions.
Put this in D2 and copy down:
=IF(C2>=AGGREGATE(14,7,$C$2:$C$1000/($A$2:$A$1000=A2),MIN(COUNTIF(A:A,A2),3)),1,0)
Use a pivot table
Insert the pivot using your whole range
Add Region/Employee to Rows field (In that order)
Add Salary (SUM) to the Values field
Below Pivot Table Design = No Subtotals, No Grandtotals, Tabular Layout
Select the drop down on Employee, Select Value Filter, Select Top 10...
Complete form with Top 3 Items by Sum of Salary
If a region does not have 3 options, the top n will appear where n < 3.
If you need to use the 1, 0 option you could just do a vlookup on this table too. Note that a error will return if they are not on this list which means they are not top 3. You can use some error handling to convert this to 1, 0

sorting in Excel with Rank Function in Group

hi, I would like to discuss on how to get sorting ascending formula from this case. Expected result is as shown in the picture in blue column. The only reference that can be used is Rank column (Yellow) and Group column (white).
Any idea how to get the rank unique expected column (blue)? the flow is go through in the group, find the min number in the rank within the group and put into the reverse order.
Assuming Group is in A1, series fill ColumnC from 1 to 10 then sort that column from where the second Group starts (C4:C10) by A A to Z and B Smallest to Largest.

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.

Irregular Range Average Based on Common Value in ID

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.

Resources