2 Replies Latest reply: Oct 30, 2012 1:59 PM by John Cavoulas RSS

    Nested IF - Need Help Deciphering

    John Cavoulas

      I've been given the task of updating/fixing a dashboard (I did not create) and am stuck deciphering a nested IF statement. It has to do with 2 dates, and what day of the week they fall on, and whether to alter the original date and create a new date, or not, I believe. Can someone look at the statement below and turn it into a word problem so I can understand what the original author was trying to do?

       

      I think it starts out with:

       

      If Creation Date - Request Date < 0.5 ThenRequest Date + 3 Else Request Date + 2) = Sun Then...(and I get lost)

       

      Here is the code:

       

      if(WeekDay((

      if(("CREATION_DATE"-"REQUEST_DATE") <.5,("REQUEST_DATE"+3),("REQUEST_DATE"+2)))) = 'Sun', ((

      if(("CREATION_DATE"-"REQUEST_DATE") <.5,("REQUEST_DATE"+3),("REQUEST_DATE"+2)))+2),

      if (WeekDay(

      if(("CREATION_DATE"-"REQUEST_DATE") <.5,("REQUEST_DATE"+3),("REQUEST_DATE"+2))) = 'Sat', ((

      if(("CREATION_DATE"-"REQUEST_DATE") <.5,("REQUEST_DATE"+3),("REQUEST_DATE"+2)))+2), (

      if(("CREATION_DATE"-"REQUEST_DATE") <.5,("REQUEST_DATE"+3),("REQUEST_DATE"+2))))) AS NEW_REQUEST

       

      Thanks All,

      John