# Re: If/Then Statement with Year

Solved
1211 1
cancel
Showing results for
Did you mean:
4 - Data Explorer

Hello there!

I am brand new to Airtable formulas and was hoping to get some help. I’m attempting to calculate NPS just for this calendar year of 2022. I was able to calculate the NPS for all of my results but when I try to modify it to add in just for the year 2022 as an If/Then statement it doesn’t work. Here is what I have been attempting to use. Thank you so much for your help!

IF(

Date}=2022

)

THEN(

{NPS Score}=BLANK(),BLANK(),

IF({NPS Score} < 7,-100,

IF({NPS Score} > 8,100,

0)))

1 Solution

Accepted Solutions
16 - Uranus

THEN() is not a function in Airtable. IF()s look like this

``````IF(
condition,
value if true,
value if false
)
``````

``````IF(
{Date} = 2022,
IF(
{NPS Score} = BLANK(),
BLANK(),
IF(
{NPS Score} < 7,
-100,
IF(
{NPS Score} > 8,
100,
0
)
)
)
)
``````

If {Date} is a full date instead of just a year then your formula should instead include `YEAR({Date}) = 2022`

2 Replies 2
16 - Uranus

THEN() is not a function in Airtable. IF()s look like this

``````IF(
condition,
value if true,
value if false
)
``````

``````IF(
{Date} = 2022,
IF(
{NPS Score} = BLANK(),
BLANK(),
IF(
{NPS Score} < 7,
-100,
IF(
{NPS Score} > 8,
100,
0
)
)
)
)
``````

If {Date} is a full date instead of just a year then your formula should instead include `YEAR({Date}) = 2022`

4 - Data Explorer

Thank you SO much!!! It worked!