# Formula not working anymore

✭✭✭✭

Hi,

I have this formula that worked in the past and now is not working, I don't know since when.

=16 - (SUMIFS({Tems en Maladie}; {Employee name}; [Employee name]@row; {Date}; YEAR(@cell) = YEAR(TODAY())))

Now the cell shows #INVALID DATA TYPE

How can this happens?

• ✭✭✭✭✭✭
edited 04/13/23 Answer ✓

This error comes from having blanks or non-date values in the {Date} range which causes the YEAR function to error out (since it is looking for a date value to pull the year from). Try this:

=16 - (SUMIFS({Tems en Maladie}; {Employee name}; [Employee name]@row; {Date}; IFERROR(YEAR(@cell); 0) = YEAR(TODAY())))

• ✭✭✭✭✭✭
edited 04/13/23 Answer ✓

This error comes from having blanks or non-date values in the {Date} range which causes the YEAR function to error out (since it is looking for a date value to pull the year from). Try this:

=16 - (SUMIFS({Tems en Maladie}; {Employee name}; [Employee name]@row; {Date}; IFERROR(YEAR(@cell); 0) = YEAR(TODAY())))

• ✭✭✭✭

@Paul Newcome works perfectly thank you!!!

• ✭✭✭✭✭✭

Happy to help. 👍️

• ✭✭✭✭

@Paul Newcome Hi Paul, new problem. This formula is working in one sheet but not in the other : =INDEX(COLLECT({Numéro de période}; {Date de début - Période de paie}; @cell <= Date3; {Date de fin - Période de paie}; @cell >= Date3); 1)

Do you see something wrong?

• ✭✭✭✭✭✭

I don't see any syntax issues. Are you getting an error or an unexpected result?

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!