# DATETIME_FORMAT with multiple date fields

Topic Labels: Formulas
Solved
728 1
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

Hello everyone !

I have records with multiples Date fields (4 fields to be exactly). So we have {date field 1},{date field 2},{date field 3} and {date field 4}.
I would like to have a formula field that shows only the year of one of these date field. Something like "If {date field 1} has no date, check {date field 2}. If not, check {date field 3}. If not, {date field 4}. If not, keep the cell empty.

I tried some of formulas, without sucess.

Thank you so much for your help!

Quentin

1 Solution

Accepted Solutions
5 - Automation Enthusiast

After somes researches and tests, I’ve got a formula that works.

``````IF({Date 1}=BLANK(),IF({Date 2}=BLANK(),IF({Date 3}=BLANK(),IF({Date 4}=BLANK()," ",DATETIME_FORMAT({Date 4},'YYYY')),DATETIME_FORMAT({Date 3},'YYYY')),DATETIME_FORMAT({Date 2},'YYYY')),DATETIME_FORMAT({Date 1},'YYYY'))
``````

Thank you !

Quentin

5 - Automation Enthusiast

After somes researches and tests, I’ve got a formula that works.

``````IF({Date 1}=BLANK(),IF({Date 2}=BLANK(),IF({Date 3}=BLANK(),IF({Date 4}=BLANK()," ",DATETIME_FORMAT({Date 4},'YYYY')),DATETIME_FORMAT({Date 3},'YYYY')),DATETIME_FORMAT({Date 2},'YYYY')),DATETIME_FORMAT({Date 1},'YYYY'))
``````

Thank you !

Quentin