If cell equals last years year (2016) put yes if not blank

Jaffabfc

Board Regular
Joined
Jul 5, 2013
Messages
196
Office Version
  1. 365
Platform
  1. Windows
In cell A2 i have "=IF(C2="","",TEXT(C2,"yyyy"))" in cell c2 i have 01/01/2016 so in cell A2 i have the result of 2016.

Which is correct.

I am wanting in T2 a formula to say Yes this was last year (2016) so far i have the formula of "=IF(YEAR(TODAY())-1=A2,"Yes","")" but it isnt working correctly.

Obviously in 2018, it will just show blank unless A2 shows 2017.

Can someone help?

Thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi, try changing your A2 formula to:

=IF(C2="","",YEAR(C2))

the TEXT() function returns text and that is probably causing your comparison problem.
 
Upvote 0
try to put value() around A2,

=IF(YEAR(TODAY())-1=VALUE(A2),"Yes","")
 
Upvote 0
Hi, try changing your A2 formula to:

=IF(C2="","",YEAR(C2))

the TEXT() function returns text and that is probably causing your comparison problem.


knew it would be something simple that i am missing.

thanks a lot.
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,726
Members
449,465
Latest member
TAKLAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top