Google-sheets – Formula Error: =IF( SEARCH() ); Visual Reference to Question

google sheetsgoogle-sheets-arrayformulagoogle-sheets-dates

I know I'm very close with my formula: =IF(SEARCH("Wednesday", (A3:A)), "workday", 0),

But I must be missing something here…: I can't get this formula to display the value "-" when I run it on a cell that is False. (I'm trying to paste this formula on every row to have a quick visual reference for whether or not that day was a workday. Currently my days off are Wednesday and Friday.)

Would anyone help me understand where this formula needs to be corrected?

P.S. I did look a little bit of searching on this website for about five minutes; is that enough time to warrant asking this question? I have also provided a visual reference to the Sheet itself.

Google sheets is so powerful, I had no idea. Fun to be learning this.

Formula that doesn't work as expected: =IF(SEARCH("Wednesday", (A3:A)), "workday", "-")

An image of the formula =IF(SEARCH("Wednesday", (A3:A)), "workday", 0)

Best Answer

Instead of using "Wednesday" (or "Friday") you can use the WEEKDAY function in combination with the SWITCH function.

=SWITCH(WEEKDAY($A3),4,"workday",6,"workday","---"))

You can also add to this formula the ARRAYFORMULA function so your results will auto-expand for a whole array.

=ArrayFormula(SWITCH(WEEKDAY($A3:$A),4,"workday",6,"workday","---"))


Functions used: