I need an IF statement that equals to a list. I have public holidays on a list named "PublicHolidayWorked". If the date on a timesheet equals to the list of public holidays then give me what is in Column O else 0.00. So what I've done is =IF(D2=PublicHolidayWorked,O2,0.00) but it doesn't work correct.
2 Answers
Comparing a single value to a list results in an array of TRUE/FALSE values, not a single TRUE/FALSE result, so to get the answer that way you have to do something with the resultant array, better to use COUNTIF like this:
=IF(COUNTIF(PublicHolidayWorked,D2),O2,0)
I've replicated and it works fine
The issue is that what you've written probably doesn't actually work as you need to use strings! meaning quote marks!
=IF(D2=PublicHolidayWorked,O2,0.00)should result in an error with #NAME?
=IF(D2="PublicHolidayWorked",O2,0.00) 2