Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have 3 fields in excel as follows:

Cell A1=2012 A2=12 A3=15 which contains year, month & date value respectively. And I want to make a date string out of it.

I know it's very easy to achieve using Date() function. But I also want the cell to remain blank if any of A1,A2 or A3 is blank.

Anybody has a formula/logic for this?

share|improve this question
1  
Answer is =IF(COUNT(A1:A3)=3,DATE(A1,A2,A3),"") –  Tejas Sep 16 '12 at 12:44
1  
You should post your answer in the answers area. That way, you can mark your question as answered, and gain some rep. –  dangowans Sep 16 '12 at 13:53

1 Answer 1

Another option in Excel 2007 or later would be to use this formula

=IFERROR((A1&"-"&A2&"-"&A3)+0,"")

Not only would that show a blank if any of the 3 cells is blank but would also show a blank if you had an invalid date like 2012-2-30. Your version would show that as 1st March

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.