rah
rah

Reputation: 33

excel year function combining formulas

I have column 1 containing dates formated in mm/dd/yyyy. I want to use the =YEAR function to make it only show the years in column 2 (I cannot use the format cell method to do this I have to use the YEAR function.)However I want it to keep the blank cells in column 1 blank in column 2 by using the IF(ISBLANK function.

How do I combine the =YEAR and =IF(ISBLANK functions together without getting an error message?

Upvotes: 0

Views: 97

Answers (2)

nutsch
nutsch

Reputation: 5962

Here's something you can try, and this type of question belongs on SuperUser.com

=IF(LEN(A1)=0,YEAR(A1),"")

Upvotes: 1

Jerry
Jerry

Reputation: 71538

Try using:

=IF(ISBLANK(A1),"",YEAR(A1))

Assuming that the first date is in A1.

Upvotes: 2

Related Questions