Excel - Highlight holidays on timesheet based on list of holidays - excel

I have a list (for the rest of the year) of our recognized holidays at work, I want to highlight the row (just like I have the days off) if the day is one of the holidays. I have the dates for the holidays in text format in row O.
Them being text I figured I could use the same formula I am using for off days
=OR(LEFT(TEXT(C$8,"ddd"),2)=LEFT($G$5,2),LEFT(TEXT(C$8,"ddd"),2)=LEFT($H$5,2))
I just cant figure it out :/

Working off your previous formula I would use something along the lines of the following:
=SUMPRODUCT((LEFT(TEXT(C$8,"mmm"),3)=LEFT($O$3:$O$12,3))*(DAY(C$8)=--RIGHT($O$3:$O$12,2)))
Basically the formula will return the value of 1 which is equivalent to true for excel math if the first three letters of the month match and the date's day number match. All other results should return 0. It is also imperative that you do not have duplicate holiday dates in your list or the formula will return a value greater than 1. But there are ways around that too, but that is a follow up question.

Related

Conditions in Excel: skip cells with dates without a year

I have the results of a survey with birthdays in various date formattings.
01.01.1990
02/03
04.05 etc.
Every time Excel sees a day and a month without a year it implies the current year and puts it in the cell without any hesitation. So, when we try to extract a year, we get not the error we expected but the current year, which is nonsense.
How can we avoid this behaviour?
The desireable result is:
One column with one formula
If the year is written, we extract it using =YEAR()
If it is absent, we just do anything else, for instanse put "".
Basic change of formatting doesn't change the implication of the current year. And if we change the format of the whole column from date to text, we cannot use the formula "YEAR" anymore to any of the cells.
This is a task for students who can deal with Excel and Google Sheets only, Python is not an option.
I would be very grateful for any help!
Both Excel and Google Sheets stores date as a number (day count) starting from 1900/01/01 so it either assumes year for you or doesn't recognize it as date at all.
If you convert date to number, 1900/01/01 will be 1, 2023/01/16 will be 44942 (as it is 44942 day counting from 1900/01/01).
I assume that survey can't be filled by people born this year so just "filter" them out:
If date is in A1 use formula:
=IF(OR(YEAR(A1)=2023,YEAR(A1)=1900),"",YEAR(A1))
This will print nothing if captured year is 2023 or 1900 (this behavior also possible when dealing with dates without years).

count repeated date as one in excel

i want to count working days in a week by mentioned dates only like in picture only 4 working days will be considered in filtered data "year, month, and Week are derived by induction date column.Example
Do want that repeated dates are considered into the counting or not? Anyway, you could apply workday formula (=WORKDAY (start_date, days, [holidays])) in an additional column and count from there, adding or criteria with IF formula or other logic to exclude repeated dates if you do not want to consider them.

Countif with dates does not work

I couldn't find a similar question that's why I asked a new one.
I have a worksheet with two columns - first column shows month and year in the following format "mon.year", for example "apr.2017" and the second one shows a number. The number must represent the count of some other dates filtered by specific criteria. I have those dates in another sheet - one column with name and one with a date.
What I want to do is count the number of dates for example from june 2017 from the second sheet and place the number in the second column in the first sheet.
Here is how the first sheet looks like:
And this is how the second sheet with data looks like:
The result I'm looking for is this:
So, I tried the following code but I can't figure out why it doesn't work.
Any suggestions how to improve the formula?
EDIT: So, both the comments below were helpful for me but as the formula had to be simplified at most (my colleagues work with the excel file, not me) I chose to calculate the month and year in two hidden columns, then use the countif formula on them.
You will need to bracket the dates:
=COUNTIFS('1'$B$2:$B$26,">=" & EOMONTH(A2,-1)+1,'1'$B$2:$B$26, "<" & EOMONTH(A2,0)+1)
For Excel, a date/time is just a formatted number, the number of days since a fixed epoch.
"="&MONTH(A2) is an expression which concatenates the string = with the result of the function MONTH(A2), which is 1. The result of the expression is =1, which is what COUNTIFS sees.
You're actually telling COUNTIFS to match the date/time whose serial number is 1 (December 31, 1999 at midnight). Similarly, the second criteria will match exactly on July 9, 1905 at midnight.
My suggestion for you is to compute the month and year of each date on separate columns, and use COUNTIFS on these columns.

Excel: countIFS specific day of the week and additional criteria

I was wondering what would be a formula if I want to count based on various criteria, but specifically(because I think this is what I'm having trouble) if one of those criteria should be if a date of a column equals certain day of the week (i.e. 2/2/2016 = thursday)
So basically I want to count how many orders were made on a THURSDAY with the code FTN and with any status except ABANDONED (see image attachments)
Here is the formula I used which gave me 0 when the answer should be 5:
=COUNTIFS(A2:A15,WEEKDAY(A2:A15)=5,C2:C15,"FTN",D2:D15,"<>*ABANDONED*")
Data
Dates to day of week
COUNTIFS() is picky on how the criteria is done, you will not be able to do it this way. You will need to use an array type formula.
You can use SUMPRODUCT():
=SUMPRODUCT((WEEKDAY(A2:A15)=5)*(C2:C15="FTN")*(ISNUMBER(SEARCH("ABANDONED",D2:D15))))
This will count where all three are True.

spreadsheet Determining days between two dates when criteria met

Could not find the answer to this one although it seems not too hard: calculate number of days between day and a day in the next x rows marked as a settlement day (=TRUE)
Please see example sheet for setup:
https://docs.google.com/spreadsheets/d/1E8bGpB8_xj1WECHOuP4Q0nH7Cx2FHilWvZ9h3ih0KwE/edit?usp=sharing
In C4:
=INDEX(A4:$A$1004000,MATCH(TRUE,B4:$B$1004000,0))-A4
Note: It depends on the dates in Column A being true dates and not text that looks like dates.
For Google Sheets the above formula will work but it can be truncated to:
=INDEX(A4:$A,MATCH(TRUE,B4:$B,0))-A4

Resources