+ 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