Hi Guys,
I'm stuck with one critical problem, where I need one formula.
I have two sheets
Sheet A (contains only applied leaves, not all the dates range)
Column 1 - Leave Start Date, eg 01 jan 24
Column 2 - Leave End date, eg 03 jan 24
Column 3 - Employee code, eg ABC001
Sheet B (contains entire range of dates for particular year)
Column 1 - Date range (i.e. 01 jan24 , 02 jan24 , 03 jan24 , etc in once column till 31st dec24)
Column 2 - on leave (or) present
Header row of column2,3, etc - employee code
I have a formula for this which was provided by Paul, where it checks from the Sheet A, whether employee is on leave or not.
=IF(COUNTIFS({Leave Register - 1 Range 1}, @cell <= Date2, {Leave Register - 1 Range 2}, @cell >= Date2, {Leave Register - 1 Range 3}, @cell = [ABC001]$1) > 0, "On Leave")
Sheet C (Contains Timesheet data of employees, which is being filled via Form)
Column 1 - Dates
Column 2 - Employee ID's
Column 3 - Hrs
Column 4 - Entry status (whenever an employee fills the form, it will show status as "Complete")
Sheet D (consolidated sheet for the timesheet entries and on leave status) - Need formula for this sheet
Column 1 - Employee ID
Column 2,3,4.. - Dates
I need a formula for the dates column where it should check the leave register, whether employee is on leave or not from sheet B, and if employee is not on leave, it should check the part whether timesheet entry is available from sheet C and should reflect the status as "on leave" or "Pending" or "complete"
At present, I'm using the below formula for the marking only "complete" or "pending"
=IF(IFERROR(INDEX(COLLECT({Timesheet Consolidated Entries Range 6}, {Timesheet Consolidated Entries Range 5}, $[Employee ID]@row), MATCH([Column2]$1, COLLECT({Timesheet Consolidated Entries Range 6}, {Timesheet Consolidated Entries Range 5}, $[Employee ID]@row), 0)), "-") = [Column2]$1, "Complete", "Pending")
Your wonderful thoughts and ideas are highly appreciated.