1

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)

1
  • Welcome. Please remember that as per site guidelines when an answer addresses your question, you should accept it so others can benefit as well. – marikamitsos Dec 26 '19 at 7:08
1

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:

2
  • Thank you for explaining this! – Arie Marie Mikael Dalleis Dec 27 '19 at 18:00
  • Thanks for taking the time to answer; it took me a while to figure out how those formulas worked, but now that I understand ARRAYFORMULA better it's awesome! – Arie Marie Mikael Dalleis Dec 27 '19 at 18:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.