Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Beginner question - Add date condition to a formula

Solved
Jump to Solution
1481 3
cancel
Showing results for 
Search instead for 
Did you mean: 
alexandrachap
4 - Data Explorer
4 - Data Explorer

Hi

I'm looking to create a new field or to modify an existent one.

As of 2022, this formula was okay but in 2023, the value for H sould now be 45.94 instead of 39.27 .

Because we don't want it to have an impact on our reports and on our Page Designer, we need to add a condition that if the event took place in 2022, H = 39.27 and if the event took place after december 31th 2022, H= 45.94.

 

Could someone help me? I've been trying different things but it seems that I always forget something. Thanks a lot !

 

1 Solution

Accepted Solutions
Ron_Daniel
8 - Airtable Astronomer
8 - Airtable Astronomer

The H Value field has a simple formula that grabs the year from the date, and then assigns the value. The formula is:

IF(YEAR({Date})<=2022, 39.27, 45.94)
Note that if the Date field is empty, it will still return a value of 45.94. You could nest the formula inside of another IF statement to show nothing if the Date field is empty:
IF((Date), IF(YEAR({Date})<=2022, 39.27, 45.94), "")

Screen Shot 2023-01-12 at 1.36.43 PM.png

See Solution in Thread

3 Replies 3
Ron_Daniel
8 - Airtable Astronomer
8 - Airtable Astronomer

The H Value field has a simple formula that grabs the year from the date, and then assigns the value. The formula is:

IF(YEAR({Date})<=2022, 39.27, 45.94)
Note that if the Date field is empty, it will still return a value of 45.94. You could nest the formula inside of another IF statement to show nothing if the Date field is empty:
IF((Date), IF(YEAR({Date})<=2022, 39.27, 45.94), "")

Screen Shot 2023-01-12 at 1.36.43 PM.png

Wow, thank you so much!! It worked 😊

Happy to help!