Separating Dates Using IF Function

Closed
ajohnson - Jan 6, 2017 at 12:41 PM
Mazzaropi Posts 1980 Registration date Monday August 16, 2010 Status Contributor Last seen December 22, 2022 - Jan 6, 2017 at 01:00 PM
Hello,

I'm trying to set up an IF function, I believe...I have a spreadsheet that lists dates back to 2013 as MM/DD/YYYY. I'm trying to create a formula that would read that date (specifically the year) and then assign a number to it. For example 2014 =1, 2015 = 2, etc. I'm new to the intricacies of Excel and don't know what I'm doing.


1 reply

Mazzaropi Posts 1980 Registration date Monday August 16, 2010 Status Contributor Last seen December 22, 2022 146
Jan 6, 2017 at 01:00 PM
ajohnson, Good afternoon.

Excel have a lot of possibilities to do the same job always.

As you said that the older year is 2013, Try to do:

Supposing:

A1 --> DATE

B1 --> =IF(YEAR(A1)=2013,1, IF(YEAR(A1)=2014,2, IF(YEAR(A1)=2015,3, IF(YEAR(A1)=2016,4, IF(YEAR(A1)=2017,5,"")))))

OR

B1 --> =YEAR(A1)-2012

Remember to format B column as number.

Is that what you want?
I hope it helps.
--
Belo Horizonte, Brasil.
Marcílio Lobão
0