Matching pairs in excel - excel

Every week, I randomly pair together two users for a peer review. Sometimes users have the week off. Each user is assigned an ID # to make the pairing chart simple.
ID # Name Week 1 Pair Week 2 Pair Week n Pair...
1 Bob 2 3
2 Doug 1 -
3 Brian 4 1
4 Joe 3 -
5 Mary 6 7
6 Jane 5 10
7 Ron 10 5
8 Mark - -
9 Steve - -
10 Anna 7 6
I want to take this pairing chart and send out a weekly reminder email with the pairing. Emails should look like this.
Example 1:
Week 1 Pairings:
Bob
Doug
Brian
Joe
Mary
Jane
Ron
Anna
Example 2:
Week 2 Pairings:
Bob
Brian
Mary
Ron
Jane
Anna
Just each pair in one column, one after the other, no separators. I do the grouping with formatting. There should be no duplicates (for example, in Week 1 - Bob (1) is paired with Doug (2), but Doug (2) is also paired with Bob (1). Only one of these pairs should appear in the weekly reminder email).
How can I use Excel to get this information based on the original pairing chart?

F2=IFERROR(INDIRECT("B"&MOD(SMALL(IF(C$2:C$11="-","X",IF(C$2:C$11<$A$2:$A$11,C$2:C$11,$A$2:$A$11)*1000+ROW($B$2:$B$11)),ROW(A1)),1000)),"")
It is an array formula, click ctrl+shift+enter to complete.

Related

EXCEL SumIf with multiple conditions from another cell/array

A
B
C
1
User
Task
Hours
2
Jim
AA-1
10
3
Mike
AA-2
12
4
Jim
AA-3
13
5
Steve
CC-5
14
6
Jim
BB-1
15
7
Mike
BB-3
5
8
Steve
BB-4
10
9
Mike
CC-5
8
The table is way bigger and there are more than just AA, BB and CC type of tasks.
I want to be able to get how many hours Jim spent on tasks that start by AA* or BB*
This is simple with a sumifs but the problem is when I have 20 different type of tasks and I Want to get a lot of people results.
So I want to get in a row how many hours Jim spent on AA, BB and CC tasks and in the next row how many he spent on DD, EE, FF.
Basically I would like a sumif like (just look at the last part):
('SHEET1'!C:C,'SHEET1'!E:E,$B$3,'SHEET1'!G:G,"AA*,BB*,CC*")
Or even better if the AA*,BB*,CC* part were in another cell to easily change it.
Try the following formula-
=SUMIFS($C$2:$C$9,$A$2:$A$9,$F3,$B$2:$B$9,G$2)
You may also use following formulas.
F3==UNIQUE(A2:A9)
G2==TRANSPOSE(SORT(UNIQUE(TEXTSPLIT(B2:B9,"-"))))&"*"
So thanks to Harun24hr answer I started to think in doing it in different steps.
As I stated above I have the following table:
A
B
C
1
User
Task
Hours
2
Jim
AA-1
10
3
Mike
AA-2
12
4
Jim
AA-3
13
5
Steve
CC-5
14
6
Jim
BB-1
15
7
Mike
BB-3
5
8
Steve
BB-4
10
9
Mike
CC-5
8
The issue is that I might have a lot of different type of tasks and I need to group some results, so I created another table to stablish the groups:
A
B
1
Group
Task
2
a
AA*
3
a
BB*
4
b
CC*
5
a
DD*
This new table is easier to maintain and I can then add a new column on the main table that represents the group based on this grouping table and then do the calculation with a simple sumif.
Thanks a lot for all the help.

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

Equal distribution formula based on preset values. Excel

e.g. There are 300 apples. There are 100 people. Each person has a preset value (represented as a number 1 to 5). 1=1 apple, if their value is 5 they get 5 apples etc. But there are 300 apples available so each person is going to get more then the value says they "deserve". Or one day there are only 200 apples and every one gets less then what the value states says they "deserve". Is this possible in excel?
NAME VALUE
john 5
james 5
sam 4
matt 5
mike 3
steve 2
etc...
This absolutely sounds like a perfect problem for Solver to handle. As you know, this in included within Excel's addins. It can deal with all the variables you mentioned.

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.

Count the number of absent in different sheet excel

I have 6 worksheets and each containing names of workers. The first sheet just picks data from the other five sheets each representing a week day. The other five sheets contains names of workers which is in a column A, their working hours in column B and column C is whether they are absent or not. I want a way to collect information to the first sheet such that there will be a column that will count the number of days a worker has being absent.
When a worker is absent it is marked "absent" else it is left blank.
Can I use it with VLOOKUP included?
You should be able to use a "=COUNTIFS(criteria_range1,criteria1,criteria_range2,criteria2,etc.)"
statement which might look something like: "=COUNTIFS(WorkerNameRange,WorkerName,AbsentColumn,AbsentIndicator)"
or
"=COUNTIFS(ColumnA,WorkerName,ColumnC,AbsentIndicator)"
Okay, you didn't provide a lot of information, so here is my best answer based off of some made up sample data.
We will use 3 workers, George, Bob, and Steve. George works 8 hours/day, Bob 6 hours/day, and Steve 4 hours/day. So this is what I assume the Monday sheet would look like
Monday
Bob and Steve both missed work (rough weekend), so we won't count their hours on the Total sheet. We will also count this as 1 absent for both.
Worker Hours Absent
George 8
Bob 6 absent
Steve 4 absent
Tuesday
Tuesday is similar to Monday except that only Steve was absent.
Worker Hours Absent
George 8
Bob 6
Steve 4 absent
Total Sheet
We will assume that no one was absent for the rest of the week. So George should have gotten in 40 hours with 0 days absent. Bob missed a day, so he only got in 4*6=24 hours. Steve missed two days, so his hours will be 3*4=12. Bob will have 1 absent and Steve will have 2.
Worker Hours Days Absent
George 40 0
Bob 24 1
Steve 12 2
To sum up the hours they were present, we can use the following formula in the Hours column on the Total sheet.
=SUMIFS(Monday!$B$2:$B$4,Monday!$A$2:$A$4,Total!A2,Monday!$C$2:$C$4,"")+SUMIFS(Tuesday!$B$2:$B$4,Tuesday!$A$2:$A$4,Total!A2,Tuesday!$C$2:$C$4,"")+SUMIFS(Wednesday!$B$2:$B$4,Wednesday!$A$2:$A$4,Total!A2,Wednesday!$C$2:$C$4,"")+SUMIFS(Thursday!$B$2:$B$4,Thursday!$A$2:$A$4,Total!A2,Thursday!$C$2:$C$4,"")+SUMIFS(Friday!$B$2:$B$4,Friday!$A$2:$A$4,Total!A2,Friday!$C$2:$C$4,"")
What this does is uses a series of SUMIFS() functions to check each day if the name matches and if they were absent. If they weren't absent, it adds their hours to the total. If they were absent, it does nothing. So we get the correct hour totals. We could just count the absents and then do some math with the number of days absent, but I don't know if you have people who might work different hours different days (e.g. 4 hours Monday, 6 hours Tuesday, etc.)
To count the hours, we will use a simple COUNTA() function.
=COUNTA(Monday!C2,Tuesday!C2,Wednesday!C2,Thursday!C2,Friday!C2)
This counts all cells in that workers Absent columns that are not blank. This allows you flexibility to use any mark for absent as long as blank means "not absent".
There are other ways this spreadsheet could be made more robust with Table formatting, but I will leave it up to you to do the research.

Resources