Numbers IF function returns FALSE: text year vs date year

Having trouble getting simple IF function to work correctly. Cell B2 'YrEND 2025' Cell C2 '1/1/2025'

IF((RIGHT(B2,4)) = (YEAR(C2)),"TRUE","FALSE") returns FALSE.

Please, what is wrong with my formula?

Thanks in advance.

iMac 21.5″, macOS 12.7

Posted on Jan 6, 2026 6:10 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 6, 2026 7:46 PM

Convert the string to a number by multiplying it by 1 or using the VALUE function. Also, but unrelated to your question, remove the quotes around TRUE and FALSE. The quotes turn them into strings instead of the boolean values they should be.


=IF(RIGHT(B2,4)×1 = YEAR(C2),TRUE,FALSE)


Also be careful to not have any extraneous spaces at the end of "YrEnd 2025". RIGHT(B2,4) will not return the full year, it might be "025 " or "25 " or "5 ". You can use TRIM(B2) in place of B2 in the formula to strip out any extraneous spaces, just in case.


4 replies
Question marked as Top-ranking reply

Jan 6, 2026 7:46 PM in response to BettyMitch

Convert the string to a number by multiplying it by 1 or using the VALUE function. Also, but unrelated to your question, remove the quotes around TRUE and FALSE. The quotes turn them into strings instead of the boolean values they should be.


=IF(RIGHT(B2,4)×1 = YEAR(C2),TRUE,FALSE)


Also be careful to not have any extraneous spaces at the end of "YrEnd 2025". RIGHT(B2,4) will not return the full year, it might be "025 " or "25 " or "5 ". You can use TRIM(B2) in place of B2 in the formula to strip out any extraneous spaces, just in case.


Numbers IF function returns FALSE: text year vs date year

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.