I am trying since many hours as of how the statement will come true or false based on 2 different criteria. I have 2 worksheets in this scenario.
In Sheet1 I have multiple columns including Date, Age, Gender, Name of employee, joining date, etc. ranging from row 1 to row 2000.
In Sheet2 I have put just 2 columns "Date" and "Name of Employee", and in sheet2 (for checking purpose) I "Date" column i have added Date (e.g. 22-August-22) and in next column I have added "Name of employee" (e.g. David), now i would like to see/match/lookup if David was present on 22-August-22 for confirmation and if both (22-August 22 and DAvid) is available in Sheet1, therefore in a month i need to check all the employees name with different dates multiple times.
Therefore the motive is if a particular employee "E.g. David" was present on August 22, the condition should come true, however if David was not present on 22-August the condition should return false. there are many employees for whom i need check these kind of status.
For this i have used multiple formulas but could not get the desired results. one of stackoverflow friend has suggested a formula which is fulfilling the goal but meeting only 1 condition which is Name however it is not considering the Date.
E.g. In sheet 2 if i only mention the name of employee the condition is returning true, whereas the formula should also check that the name with required date should be matched, and if any of them not met the condition should return false
The formula I am using is
=AND(IFERROR(VLOOKUP(A3,Sheet1!A$3:A$2000,1,0),0),IFERROR(VLOOKUP(B3,Sheet1!B$3:B$2000,1,0),0))
I have also used the other formulas but could not get desired results
=AND(vlookup(A3,Sheet1!A$3:A$2000,1,0),vlookup(A3,Sheet1!B$3:B$2000,1,0))
Please see the examples in below mentioned screenshots as well
I shall remain thankful if anyone out of could resolve the problem by suggesting any formula or any VBA code.
Countifs should work, =COUNTIFS(Sheet1!D:D,Sheet2!B2,Sheet1!A:A,Sheet2!A2)
, if it returns 0 then the employee isn't available that day, if it returns any other number they were although I think you shouldn't get more than 1.