Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Date to Month / Year 2

Status
Not open for further replies.

earnestwong

Programmer
Joined
Jan 14, 2008
Messages
3
Location
GB
Hi i have a date field in one column, in another i have the following...

=TEXT(A1,"mmm yy")

This works fine as long as there is data in the field if the field is blank then it just returns Jan 00. How can i get it to not display Jan 00 if the date field is blank?

thankyou,

Erny
 
One way would be to check if the cell is blank:
Code:
=IF(ISBLANK(A1),"",TEXT(A1,"mmm yy"))
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Perfect, your worth a star!

many thanks.
 
Glad I could help, thanks for the star [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Using a conditional formula, you could do something like this:

=IF(A1="",#"",TEXT(A1,"mmm yy"))

If the cell is blank, it will fill the destination cell with "N/A", which may or may not work for you. I'm not sure how you would get it to be blank.
 
Whoops, I see someone else already answered this, I walked away and then came back and replied before checking other replies. This formula will also work to give you a blank cell:

=IF(A1="",TEXT("", 0),TEXT(A1,"mmm yy"))
 




May I as why you want mmm yy in the column. It is virtually worthless as anything except a display, since you can CALCULATE with it or SORT with it.

Wh not just FORMAT the Date Column as mmm yy

faq68-5827.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top