function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Danny HartleyDanny Hartley 

Help with this formula

I was wondering if anyone could tell me why this formula is not working?  Thanks in advance.

IF(
  OR(
    AND (
      VALUE( MID(TEXT( CreatedDate ), 12, 2))  >= 17, 
      VALUE( MID(TEXT( CreatedDate ), 12, 2))  <= 7
    ),
    IF(MOD(DATEVALUE( CreatedDate ) -  DATE(1900,1,7),7) = 0, true, false),
    IF(MOD(DATEVALUE( CreatedDate ) -  DATE(1900,1,7),7) = 6, true, false)
  )
  true, false
)
Best Answer chosen by Danny Hartley
Malni Chandrasekaran 2Malni Chandrasekaran 2
Danny,
Please try, 

IF(
  OR(
    AND (
      VALUE( MID(TEXT( CreatedDate ), 12, 2))  >= 17, 
      VALUE( MID(TEXT( CreatedDate ), 12, 2))  <= 7
    ),
    IF(MOD(DATEVALUE( CreatedDate ) -  DATE(1900,1,7),7) = 0, true, false),
    IF(MOD(DATEVALUE( CreatedDate ) -  DATE(1900,1,7),7) = 6, true, false)
  ),                                              //This comma was missing
  true, false
)

All Answers

Danny HartleyDanny Hartley
This is the error I am receiving.  Also, the point of the field is to mark a checkbox true if the time is after 5pm or anytime on Saturday or Sunday.  Thanks.
Danny HartleyDanny Hartley
 Error: Syntax error. Missing ')'
Malni Chandrasekaran 2Malni Chandrasekaran 2
Danny,
Please try, 

IF(
  OR(
    AND (
      VALUE( MID(TEXT( CreatedDate ), 12, 2))  >= 17, 
      VALUE( MID(TEXT( CreatedDate ), 12, 2))  <= 7
    ),
    IF(MOD(DATEVALUE( CreatedDate ) -  DATE(1900,1,7),7) = 0, true, false),
    IF(MOD(DATEVALUE( CreatedDate ) -  DATE(1900,1,7),7) = 6, true, false)
  ),                                              //This comma was missing
  true, false
)
This was selected as the best answer