Simple Group By In Excel - excel

I have a table of expenses with the supplier and the amount like:
supplier | amount
=====================
Jon | 13
Jon | 12
Jane | 3
Jack | 15
Jon | 2
Jack | 8
Now I like to know how much I spent for each supplier. The result should be
supplier | total
=====================
Jon | 27
Jane | 3
Jack | 23
The second table should get created dynamically so if I add "Jenny" to the first list it will show up as well.

Create a pivot table, reference your data table as the data source and place suppliers as row and amount as values. Make sure your settings for the value field is set to sum.
Then make sure your pivot setting is set to update whenever the datatable changes.

Related

Excel 2 tables different items some same items have same id, compare value in the row. (power pivot)

I have two tables (and more coming) of items with each a unique id.
However, in table 1 (month 1) there might be 5 items.
In table 2 there might be 4 of the 5 previous ones (still the same id) and 1 other one.
and in table 3 there might be 2 left of those (also still the same id) and 8 new ones.
What i try to do is compare the values of those same ID's. Preferable looking at the latest table and only use those current ID's as the old ones that are no longer in the lists became irrelevant.
Table 1
+-----+--------+------------------+
| id | name | times sold total |
+-----+--------+------------------+
| 11 | banana | 100 |
| 23 | apple | 0 |
| 66 | bread | 80 |
+---+-+--------+------------------+
Table 2
+-----+--------+------------------+
| id | name | times sold total |
+-----+--------+------------------+
| 11 | banana | 192 |
| 23 | apple | 0 |
| 71 | cookie | 30 |
+---+-+--------+------------=-----+
Actually the most relevant information I am trying to retrieve is....
which item is in the newest table that is ALSO in the first table and has not sold anything since the first table. (or not sold a lot).
I tried using power pivot in excel, but I just can not get it to work.
ID's always stay the same. all other columns can vary (also the name can change).
It seems very simple to do, but I just need someone to tell me the steps in power pivot.
Or maybe even another tool, as long as i reach my goal.
(I know i could paste every new column of "times sold total" next to the old table and compare with a formula, but the items are not always the same so i don't think i can easily copy paste it.
I hope i explained clear what I am trying to do.

List items from another list that have a value against them

I have 3 columns, the first column has data in it, against which the second one has some data.
Now I need to get a list of all the items in the first column in the third column.
The sheet as as below
Name | QTY | ACTIVE
----------------------
Apple | |
----------------------
Oranges | 10 |
----------------------
Pears | 5 |
----------------------
Plums | |
It needs to look like this
Name | QTY | ACTIVE
----------------------
Apple | | Oranges
----------------------
Oranges | 10 | Pears
----------------------
Pears | 5 |
----------------------
Plums | |
How can I do this either using a formula or a script.
What i've put above is just an example, its actually a long list of items against which there may or may not be quantities, therefore I only need a list of the items with quantities against them.
Thanks in advance.
if your using google sheets then you can use a filter function. Enter the formula and all the results will be listed in the cells below. Only items from column A that have data in Column B will be displayed.
=filter(A2:A,NOT(ISBLANK(B2:B)))
How it works
=filter(range,criteria)
You can also pull both the Name and Quantity by widening your range to include column B
=filter(A2:B,NOT(ISBLANK(B2:B)))
Note: If you get a #REF! error then you may not have left enough blank cells below your filter cell for the results to be displayed.
https://support.google.com/docs/answer/3093197?hl=en

Repeat formula until next occurrence in another cell

I'm having troubles creating an Excel formula to repeat the same copy down a column until I come to a new "person". The reason I'm doing this is to Index(Match) later to grab all this data. If I am totally off, and there's an easier way to grab this data than run a formula down 15k rows, I'm all ears. The main problem is that my categorical data (Person) is stacked on top of the data that I want to match it with (Work Positions).
The data looks like this:
Description | Status
Bob | C
Sales |
Marketing |
Management |
John | C
Sales |
Management |
Tony | C
Management |
Ideally, I'd like the data to look like this after running the formula down ColA:
Person | Description | Status
Bob | Bob | C
Bob | Sales |
Bob | Marketing |
Bob | Management |
John | John | C
John | Sales |
John | Management |
Tony | Tony | C
Tony | Management
I've tried writing an If() statement to target the "C" in ColC, as it is always there to discern a change in "Person". However, I can't figure out how to do this as of yet. Is there a way to write a formula that says keep pasting the same value until you hit the next "C", then change your paste value? Thanks for any and all help and please, don't hesitate to ask any clarifying questions!
=IF(C:C="C",B:B,A1)
Put this in A2 and clear "Person" then drag down the list.

Is it possible to populate sumif with dynamic range

I have the following data in Excel Worksheet A, which is a basic ledger of expenses:
The initial data looks like:
Week | Amount | Payee | Category
1 | 10.00 | John | Cookies
1 | 12.00 | Bill | Cookies
3 | 7.08 | Jason | Oranges
...
And I have assigned categories and calculate subtotals like this on another sheet using SUMIF :
Category | Total | Include?
Cookies | 22.00 | True
Oranges | 14.87 |
...
I'm trying to get to a report that sums if that Include? boolean is set. By using SUMIF again, I can summarize by week:
Total IncludeSet?
1 100.06
2 100.3 22.00
3 80.07
4 77.29
...
I know I could create an Extra column, and I could also try a SUMIFS and apply multiple criteria, but I'm up for learning how the pros would tackle this. At some point, I should just put this into MATLAB or a database.

Find Top Summed Subvalue by Name and State in Excel

I have an Excel table with states, names, and counts. I am trying to find the top name by sum of the count for each state. So, for example, with the following:
State | Name | Count
IA | Joe | 10
IA | John | 10
IA | Joe | 5
NE | Joe | 5
NE | John | 10
NE | John | 15
NE | Joe | 10
NE | Amy | 30
OH | Joe | 10
OH | John | 10
OH | Amy | 5
OH | Joe | 5
The expected results would be:
IA | Joe (15)
NE | Amy (30)
OH | Joe (15)
Any ideas on how to do this? Maybe something with pivot tables?
Couple of approaches stand out
1) use 2 pivots one that has row labels of name and states as column labels and sums the values. Second pivot is based on first pivot uses lists names as row labels and max of state as values, then use conditional formatting to high light those with the same grand total.
2nd option is similar to first but instead of using second pivot have seperate values for each state that have the formula (=max) of the state in the pivot then base the conditional formatting on that.
3rd option would be define it as a table and then use embedded SQL with the form to write a query to give you the sum and max by state Don't have an example of that one yet.

Resources