Sum of values in column for each value in adjacent column - excel

I have some data on number of pages printed which is basically a row for each print job with username and number of pages. I want a total of pages for each user.
my data looks like this:
COL1 COL2
dave 2
john 3
dave 1
sally 5
sally 1
john 2
dave 4
ben 8
and I want to end up with:
COL1 COL2
dave 7
john 5
sally 6
ben 8

=SUMIF(COL1:COL1,"dave",COL2:COL2)
Note that doing it this way will require you to enter each name individually when counting. Watch out for circular reference.

Use Pivot tables. It's exactly made for analysis as you describe. Pivot tables is a builtin feature in Excel and a quite powerful analysis tool.
Start with selecting your data to be analyzed and then make a pivot table out of that data.

Related

Subtract two range values for matching ones excel

I have come across of the problem that, I don't know how to solve in efficient way. So I have two tables like these:
Table 1
Company Score
Apple 10
Banana 5
Kiwi 4
Pineapple 2
Table 2
Company Score
Apple 4
Pineapple 3
Kiwi 2
Strawberry 1
Then in my result table in which I have company names listed in one column, like below. Right next to this I would like to show the differences which should be the first table values - the second table values where company names match(the list can be in different order that is why, I need to check it before subtracting).
Table 3
Company Result
Kiwi 2
Apple 6
Banana -5
Pineapple -1
I can do this with nested IF function to check every cell one by one, but I assume there might be more efficient way. I wonder if you have one.
Thanks to #ScottCraner's comment, I solved it with two sumifs subtracted from one another with this formula. I entered this in Column D66 and dragged down
=SUMIF($C$36:$C$45;$C$66:$C$75;D$36:D$45)-SUMIF($C$51:$C$60;$C$66:$C$75;D$51:D$60)
1st Sum if: Where C36-C45 is my first list of companies, C66-C75 is the list of companies that I have in the results table, D36 -D45 is the score list from the first table.
2nd Sum if: Where C51-C60 is my second list of companies, C66-C75 is the list of companies that I have in the results table, D51 -D60 is the score list from the second table.

Merge two excel sheets when UserId match in both sheets

I am currently mapping the usage of an application. The app have more than 5000 users and each of those users have different prerogatives. Because this an application used by employees of a company the only way I can segment those users is by using their coresponding service.
I have two seperate excel sheets that look like this:
1/
UserId N°connection/month
1 34
2 21
3 3
4 67
5 2
2/
UserId Name Service associated
2 Peter Department 1
5 Lily Department 2
3 Sarah Department 3
1 Gary Department 1
4 Joe Department 4
What I would like is to join those two separate excel sheets. Excel needs to merge those different informations by UserId.
So what I am looking for looks like this:
UserId N°connection/month Name Service associated
1 34 Gary Department 1
2 21 Peter Department 1
3 3 Sarah Department 3
It is important to know that the two excel sheets have a different number of rows.
Does anyone have a solution ?
Thanks in advance
VLOOKUP will work, but I would suggest INDEX and MATCH be used together - it is faster and is less fragile than VLOOKUP. It also doesn't require the UserID to be at the beginning of the row. A quick search will yield a result.
I don't know if I got your question. But if I did, this should be pretty easy to do using VLOOKUP formula on the merged sheet.
This link might help: https://www.techonthenet.com/excel/formulas/vlookup.php

How can I combine two lists?

I was wondering how I can insert a data from one table to another.
For example, lets say we have a table with the titles
ID NAME
1 Joe
2 Bob
2 Adam
and another table with the titles
ID COLOR
1 Red
2 Green
Depending on the ID value, I want to add the COLOR data to the first table so it will look like
ID NAME COLOR
1 Joe Red
2 Bob Gren
2 Adam Green
I apologize for the format, wasn't sure how to make a table. The tables can be on a same sheet or can be different sheets. I have multiple tables that I want to combine and if I can get any help I would appreciate it.
It looks like you need a simple VLOOKUP function. This link will get you started.

Lookup with multiple criteria, one a MAX value

I am trying to lookup the LOCATION of an employee (NAME) and their MANAGER from the most recent month (largest month number) in a particular QUARTER in data like this:
NAME LOCATION MANAGER QUARTER MONTH
Ryan Smith Sioux Falls Rick James 3 7
Jane Doe Tampa Bobby Brown 3 7
John Rogers Tampa Tracy Lane 3 7
Ryan Smith Sioux Falls Rick James 3 8
Jane Doe Denver Thomas Craig 3 8
John Rogers Tampa Cody Davis 3 8
So if I know the name of the employee and the quarter I'm looking up, the results should display who their last manager was and the location they were in, as these may change month to month.
I have used an INDEX and MATCH array formula:
{=INDEX($B$2:$B$7,MATCH(A12,IF($D$2:$D$7=D12,$A$2:$A$7),0))}
but this just provides the first match and not necessarily the most recent month in that quarter. I attempted to include a MAX function which looked something like this:
{=INDEX($B$2:$B$7,MAX($E2:$E7,MATCH(A12,IF($D$2:$D$7=D12,$A$2:$A$7),0)))}
but that didn't quite get me there either.
What formula do I need to get this to work?
I think I'd choose a PivotTable for its versatility and speed:
I think a pivot table is probably the best option and can easily be modified with the filters when new entries are added to the underlying data. I was working on a solution with a formula, but it requires you to add a lookup column.
The formula for the lookup column is: =E6&" "&H6&" "&I6
I wasn't clear on how the OP was going to be "entering" his employee name and quarter, so I had to make an assumption that it would be in a separate column:
And the formula in column B (which is cumbersome) is:
=VLOOKUP(A6&" "&MAX(IF(H1:H100=NUMBERVALUE(RIGHT(A6,1)),I1:I100)),$D$6:$G$11,3,FALSE)&", managed by "&VLOOKUP(A6&" "&MAX(IF(H1:H100=NUMBERVALUE(RIGHT(A6,1)),I1:I100)),$D$6:$G$11,4,FALSE)
But it works, and as long as the lookup range is adjusted, is scaleable.

sports scoring in multiple phases in excel

I have a question about excel.
There is a sports tournament with multiple phases. And the results page looks something like this:
rank phase1 phase2
1 TOM ALBERT
2 MATT TOM
3 ROBIN MATT
The first place gets 5 points, second 3 and third 1 points.
So the summary I would like to get is like this
rank name phase1 phase2 total
1 TOM 5 3 8
2 ALBERT 0 5 5
3 MATT 3 1 4
4 ROBIN 1 0 1
I cant figure out how to generate it simply, so if I copy-paste the results from phase3 to somewhere in my excel sheet, the summary page would also update.
If you can support me with advice or just a working template, I would be thankful!
Thank you for your time!
I've done you a basic example below...just list all 50 players in the summary page and copy the formula down as it is - as per the question it only records a value for the top 3 places, hope this helps if not please let me know :)
Example file here
Assuming the structure you defined and that when you paste phase 3 it will have its header ("phase3") on the same row as the other results, you could have the following formula on your Table 2:
{=SUM(IF(IFERROR(MATCH($B2,INDIRECT("Sheet1!"&CHAR(64+MATCH(C$1,Sheet1!$1:$1,0))&":"&CHAR(64+MATCH(C$1,Sheet1!$1:$1,0))),0)-1,0)={1,2,3},{5,3,1},0))}
Note: entered as Array formula: CTRL + SHIFT + ENTER
Formula uses the Table 2 headers ("phase1","phase2", etc.) and the players names to find the results for each phase. It then uses the predefined arrays that determine points given per position. The final sum is to bring the result that are in array (other values in array are 0) into single value.
Total would sum results per player.
Under the rank cells you would place the following formula:
=RANK(F2,$F:$F)
Which would provide you the rank of each player (Column F containing the totals).
Note that this would not sort your rank automatically but you could easily do this with Sorting or Autofilter. Hope this helps. Cheers.

Resources