Forum Discussion

andrew wiliams's avatar
andrew wiliams
Copper Contributor
Apr 02, 2018

IF formula with dates

Hi all, thanks in advance for trying to help me.
This is the following situation : I work at a big crewing company and I have to be warned when an individual with a certain nationality (A:A="DK")reaches a date (in this case G:G) + 90 days so I know to change a contract.
I made the following formula:
=IF(AND(A:A="DK";TODAY()>=G:G+90);"DO IT";"")&IF(AND(A:A="DK";TODAY<=G:G+90);G:G+90;)
The problem I encounter is when the second IF clause returns true it shows the date not formatted ex."41234". I've tried formatting the column to show dates and various other things and it doesn't work.
Please help !

1 Reply

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi Andrew,

     

    You can update the formula as follows to force it to display the date format: 

    =IF(AND(A:A="DK";TODAY()>=G:G+90);"DO IT";"")&IF(AND(A:A="DK";TODAY()<=G:G+90);TEXT(G:G+90;"mm/dd/yyyy");)

     

    But I suggest to replace it with this:

    =IF(AND(A1="DK";TODAY()>=G1+90);"DO IT";IF(AND(A1="DK";TODAY()<=G1+90);G1+90;""))

    This is simplified syntax and makes you able to change the format as you want.

     

     

Resources