Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

can you do a date calculation in IF statement?

Hi Community,

 

I'm stuck with an if statement that seems relatively simple but it has me stumped. maybe i'm going about this all wrong and if statement is not what i should be using.

 

I have a data table with a bunch of dates for the collection of parts and i'm trying to determine how long its taking to receive the part IF the part has been requested.  The 2 date columns i am concerned with are as follows: "created_date" which is when a file is created. not every file will have the part requested, if the part associated with that file is requested, it will have a date in the "first_attempt_date" column.  The information I want the new column to return is as follows:

 

IF the first_attempt_date cell is blank, THEN return "Not Requested", ELSE return # of days it took to generate the request (first_attempt_date - created_date) here's the formula I am using that keeps generating errors.

 

I guess my question is, in an IF statement, can the ELSE part of the formula contain a date calculation?

 

Any help on how to accomplish this would be appreciated!  Thank you!!

 

  • Anonymous you have to convert your else part to string. FORMAT( <your formula>, "####" )

     

     

2 Replies

  • Anonymous you have to convert your else part to string. FORMAT( <your formula>, "####" )

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k, it worked, Thank you!!!