Skip to main content
Solved

Beginner question - Add date condition to a formula

  • January 12, 2023
  • 3 replies
  • 31 views

Forum|alt.badge.img+3

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 !

 

Best answer by Ron_Daniel

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), "")

3 replies

Ron_Daniel
Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • January 12, 2023

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), "")


Forum|alt.badge.img+3
  • Author
  • New Participant
  • January 12, 2023

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), "")


Wow, thank you so much!! It worked 😊


Ron_Daniel
Forum|alt.badge.img+21
  • Inspiring
  • January 12, 2023

Wow, thank you so much!! It worked 😊


Happy to help!