IF Statement = List

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.

6

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like