Excel Count IF 3 conditons apply - excel

Hi I am working on an employee schedule that currently looks like:
Where "# of employees on by hour" is a count of Employees that will be on at the Hour in C9:C33. 1 denotes working that day. I manually entered the numbers in the highlighted area but that's what I need to get. So Logic is Count IF C*>=(B2:B7) & C*<(C2:C7) & (D2:D7)>0

Use a =COUNTIFS():
https://support.office.com/en-us/article/COUNTIFS-function-dda3dc6e-f74e-4aee-88bc-aa8c2a866842
=COUNTIFS($B$2:$B$7, "<=" & $C#, $C$2:$C$7, ">" & $C#, D$2:D$7, ">0")

Related

Find the difference of days between 2 timestamps in Excel

I have 2 columns, date opened and date closed which have timestamps for an excel sheet with thousands of rows.
A B
1 Date Opened Date Closed
2 07/16/2019 04:19 PM 07/24/2019 11:39 AM
Issue:
If I try Days360(A2,B2) I get ####### as output. On taking cursor over the cell of Days360(A2,B2) I get message, days too large value or negative hence shown as ####
Same problem of ###### with Datedif.
=month(B2) & '/' day(B2) & '/' & year(B2) also does not work
Is there any way to calculate number of days between 2 timestamps?
=MONTH(B2) & "/" & DAY(B2) & "/" & YEAR(B2)
This works. Apparently you need double quotes and not single quote around /.

I have a time in a cell, want to minus 2 hrs and add 2hrs to the time and display in excel

I have a time in a cell, want to minus 2 hrs and add 2hrs to the time and display in excel
Example : 02/08/2020 11:00AM
So Minus 2hrs and plus 2 hrs next cell must display as 9:00AM-13:00PM
I tried the below formula but displays like 43811.0577893518 - 43811.2244560185
=CONCATENATE(A1-TIME(2,0,0)," ","-"," ",A1+TIME(2,0,0))
Subtract & add two hours (2/24) to your date
=TEXT(A1-(2/24),"hh:mm AM/PM") & " - " & TEXT(A1+(2/24), "hh:mm AM/PM")
Use TEXT to format the output:
=CONCATENATE(TEXT(A1-TIME(2,0,0),"HH:MM AM/PM")," ","-"," ",TEXT(A1+TIME(2,0,0),"HH:MM AM/PM"))

Calculate time difference in excel

I have a two dates in excel "1/2/2016 01:56:05" and "8/3/2016 06:21:46". How do I calculate the time difference between them in a format of days and hours?
Thanks!
Try this to include the spelled out hours and minutes:
=INT(A2-A1) & " days, " & TEXT(A2-A1,"h "" hours, ""m "" minutes""")
Note that since the m comes immediately (ignoring the separator text in quotes) after the h it will be interpreted as minutes and not months
I prefer to work with dates as decimals. It looks cumbersome, but I'm much happier knowing what it's doing.
What I would usually do is to have A1-A2 in cell A3, then work out the component parts separately:
Days: =INT(A3)
Hours: =INT((A3-INT(A3))*24)
Minutes: =INT(((A3*24)-INT(A3*24))*60)
Or if you wanted to do it all in one formula:
=INT(A3)&" days, "&INT((A3-INT(A3))*24)&" hours, "&INT(((A3*24)-INT(A3*24))*60)&" min"
or without using A3
=INT(A1-A2)&" days, "&INT(((A1-A2)-INT(A1-A2))*24)&" hours, "&INT((((A1-A2)*24)-INT((A1-A2)*24))*60)&" min"
It's not the prettiest or most efficient method but you can see how the times are calculated this way.
Assuming the dates are in cells A1 and A2, this will produce an answer with minutes as well in d:hh:mm format.
=INT(A2-A1) & ":" & TEXT(A2-A1,"hh:mm")
Drop the :mm if you don't need minutes.
If you want text:
=INT(A2-A1) & " days, " & TEXT(A2-A1,"h") & " hours"
If you want text with minutes:
=INT(A2-A1) & " days, " & TEXT(A2-A1,"h"" hours, ""m"" minutes""")
Using double quotes alongside each other "escapes" the quote itself and allows the extra text to appear in the string. As Ron stated in his answer, the m following an h in the same format string indicates minutes, so you can save an extra A2-A1 calculation by putting both in a single format.

Return a number and text string in Excel If statement

I am trying to create an If statement in Excel that calculates the difference between two dates (in this case "Required Submission Date" and "Actual Submission Date"), and then outputs the absolute value of this number and follows it with "Days overdue" or "Days until due" accordingly.
I have attempted converting the number to a text string after the calculation:
=IF((H11-J11)<0,TEXT(H11-J11,0)"Days overdue", TEXT(H11-TODAY(),0)"Days Until Due")
I have also attempted this:
=IF((H11-J11)<0,abs(H11-J11)"Days overdue", (abs(H11-TODAY()))"Days Until Due")
Is there any way to achieve what I am after? i.e. if the submission is overdue, it should return "XX days overdue"
Thanks
You are almost there. It should be :
=IF((H11-J11)<0,abs(H11-J11) & " Days overdue",(abs(H11-TODAY())) & " Days Until Due")
In fact you are just missing the string concatenation character &.

How to convert date to week number

How can I convert 20110114 (YYYYMMDD) to week, eg WK02-11, in excel ?
Thanks.
First convert the number in a date. Supposing your number is in A1 cell
=DATE(LEFT(A1;4); MID(A1;5;2); RIGHT(A1;2)
Then use WEEKNUM
=WEEKNUM(DATE(LEFT(A1;4); MID(A1;5;2); RIGHT(A1;2), 2)
(gives 3)
Then, if you want, you could embellish the result:
="WEEK-" & WEEKNUM(DATE(LEFT(A1;2); MID(A1;5;2); RIGHT(A1;2), 2) & "-" & LEFT(A1;4)

Resources