+ Reply to Thread
Results 1 to 5 of 5

IF statement with WEEKDAY() and OR()

  1. #1
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    IF statement with WEEKDAY() and OR()

    Hi Guys,

    Just a quick one - I can't get the below to work when F2 is 6th May 2017 (Saturday)

    =IF(WEEKDAY(ROUND(F$2,2),2)=OR(6,7),"OK","ERROR")

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,308

    Re: IF statement with WEEKDAY() and OR()

    =if(or(weekday(round(f$2,2),2)=6,weekday(round(f$2,2),2)=7),"ok","error")

  3. #3
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: IF statement with WEEKDAY() and OR()

    try

    =IF(OR(WEEKDAY(ROUND(F$2,2),2)=6,WEEKDAY(ROUND(F$2,2),2)=7),"OK","ERROR")
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,919

    Re: IF statement with WEEKDAY() and OR()

    Try this ...

    =IF(WEEKDAY(ROUND(F$2,2),2)>5,"OK","ERROR")

  5. #5
    Forum Contributor
    Join Date
    09-18-2014
    Location
    England
    MS-Off Ver
    2003/2010/365
    Posts
    119

    Re: IF statement with WEEKDAY() and OR()

    Thanks all - I guess I was using OR() incorrectly?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Criteria for query won't accept weekday function with OR statement
    By DanNGP in forum Access Tables & Databases
    Replies: 6
    Last Post: 01-25-2016, 05:41 PM
  2. Excel VBA code to return weekday name from a date then autofilters for userdefined weekday
    By studyengineering in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2016, 03:24 PM
  3. [SOLVED] If not weekday?
    By Burt_100 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2015, 04:22 AM
  4. [SOLVED] Calculate weekday end date based on sum of weekday start date and cell value
    By Rerock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2014, 09:17 AM
  5. [SOLVED] If Weekday() = vbSaturday Or Weekday() = vbSunday Then
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-09-2014, 09:48 AM
  6. If statement using weekday to give result
    By jsmity in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2008, 08:39 PM
  7. Weekday
    By LB79 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2006, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1