Count the number of absent in different sheet excel - 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.

Related

SUM UNIQUE except...?

Okay, this may get confusing, but I'll do my best to describe it.
I'm trying to calculate the amount of days a task takes to complete. So I have a spreadsheet that lists the tasks, assigns hours, and assigns a person to do that task.
So, say Task 1 has 5 sub-tasks, and each take 8 hours. If I assign Bill to each task, Bill will take 5 days to complete Task 1. That's easy.
Now, if it takes Bill 5 days to complete Task 1, but the deadline is in 4 days, I simply take 1 of the sub-tasks from Bill and assign to Bob, and viola... we now have 40 hours of work being done in 4 days.
I have all this working with the following formula:
=MAX(SUMIFS('Task List'!Q:Q,'Task List'!T:T,UNIQUE('Task List'!T:T),'Task List'!D:D,"<>"&"*Summary"))
The formula looks down column T and finds any UNIQUE names. It then basically puts those hours happening at the same time as the other hours (from column Q) since Bill and Bob can work at the same time. Another way to look at it is: the person with the most tasks assigned to them is controlling the end date, since that's the "longest" everything will take to get done.
Now the question...
There will ALWAYS be a task at the end of each project called "baking". "Baking" will always be in column H. Baking will always be assigned to a UNIQUE person not on the project... so Bill and Bob will be part of the team, but Baking will always be a different Unique person.
So what happens is the above formula is subtracting out the Baking line because it's a unique name.
But I don't want that. The Baking task will always happen after the other tasks are done and can't be done while Bill and Bob are doing their tasks.
So, what I need the formula to say is, "Look down Column T for any unique names and add the person's hours which appears the most, but ignore this if column G has "baking" in it, and always add these hours normally."
If it helps, the first image below should return the full Value of "80" because Bill is doing all the tasks and Baker is baking once Bill is done, so the total time for the project is 80 hours. However, the above formula returns "70", because "Baker" is Unique.
This one SHOULD return 70, because Bob took 10 hours from Bill's plate, but again, Baker happens after all tasks are done (Bill: 40+10+10 + Baker 10):
=SUMPRODUCT(--(E:E<>""),Q:Q)+MAX(SUMIFS(Q:Q,T:T,UNIQUE(T:T),F:F,"<>"&""))+SUMPRODUCT(--(G:G<>""),Q:Q)
This would do the trick as well. Looking for the time for gathering ingredients + max time of unique employees + time for baking.
Answered in the other thread...
=MAX(SUMIFS(Q:Q,T:T,UNIQUE(T:T),D:D,"<>"&"*Summary",G:G,"<>Baking"))+SUMIFS(Q:Q,G:G,"Baking")

Formula that provides multiple answers based on different outcomes in different cells

I have been banging my head against a brick wall trying to work out a formula, any help would be amazing!
SO....
I have three columns that work out annual leave.
COLUMN 1 = AMOUNT OF HOLIDAY A PERSON HAS REMAINING FOR THE YEAR
COLUMN 2 = AMOUNT OF HOLIDAY TAKEN IN REPORTING MONTH
COLUMN 3 = NEEDS A FORMULA TO WORK OUT IF THE PERSON HAS GONE OVER THEIR ANNUAL LIMIT, OR WHETHER SOME OF IT HAS, OR WHETHER THEY ARE ENTITLED TO THE FULL MONTHS ALLOCATION
Ie: If a person has taken 5 days holiday in COLUMN B, but in COLUMN A it is saying they have gone over their annual allowance by 2 days, the cell in COLUMN C needs to return zero (they dont get paid for holiday taken in Column 2 as they have already gone over their annual amount shown in COLUMN A)
If a person has taken 5 days in COLUMN B, but in COLUMN A they have 10 days remaining, COLUMN C should return 5 as they had 10 days remaining for the year, and taken 5 days in COLUMN B, so they are fine to be paid the 5 days they took
If a person has taken 5 days in COLUMN B, but in COLUMN A they only have 2 (2 days remaining for the year), in COLUMN C it needs to return 2 (as they are only allowed to be paid for 2 of the 5 days that took)
I have no idea how to do this...and its driving me mad! PLEASE HELP!!
How about this
=IF(A2<=0,0,IF(A2-B2>=0,B2,A2))
if you have overdrawn in column A it gives 0
if you have taken some, but not reaching over your limit, it gives number of days you have taken
otherwise (you have days remaining, but not enough to cover everything) it takes the remaining number of days
edit: changed the formula to show , instead of ; as people apparently mostly use a different regional setting than me.

Count days worked per employee number in Excel

I have a timesheet entry form that people use to enter their hours worked per day. Sometimes they enter multiple entries per day because of different areas worked.
I want to count how many days worked based on the work date. There could be multiple entries per workdate.
For example:
Employee # Date Hours
12345 11/15/17 8
12345 11/16/17 4
12345 11/16/17 3
98765 11/15/17 2
98765 11/15/17 2
98765 11/15/17 2
I have a consolidated table that sums the hours worked per employee, but I also would like the days worked. So, for example:
Employee # Hours Days
12345 15 2
98765 6 1
I can't seem to put my finger on the right formula/combination of formulas to use. Countif would work perfectly if it worked similarly to sumif.
Maybe you can try Advanced Filter,then COUNTIF and SUMIF:
Hope this helps.

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.

Tallying dates and times in excel

Is there an easy way to tally a column formatted as follows: "5/24/2013 5:48:00 PM"
What I want to do is have it tally by day of week and an hour time block, the end result I'm looking for would look like the following:
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
1:00-2:00AM 10 2 8 7 3 12 15
2:00-3:00AM 5 4 7 7 9 11 18
et cetera. This is an extremely large data set so avoiding doing this by hand would be amazing. I apologize if this is a terrible question, I tried searching though other people's questions to no avail.
Not knowing the details, I would try to use a PivotTable.
There is the ability to group by dates; see this page for details (including a fancy animation).
Some additional searching should turn up a lot of resources on PivotTables; they are very powerful.
I'd assign a number to the rows/columns and then use sumif().
I would create add two columns: one with =Hour(A2), other with =WeekDay(A2) (example for row 2, assuming dates are on column A).
Then, use PivotTable on all data.
Regard formats: WeekDay must be formated as ddd or dddd and Hour as numeric.

Resources