Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Hiding an unintended value

if I9 does not have a date then J9 read "118 Years, 0 months, 18days and I want it to be blank. Any help would be greatly appreciated. I tried the basics but then just a FALSE reading.

J9 Formula: =IF(K9<"","Placed Out of Service",(DATEDIF(I9,NOW(),"y")&" years, "&DATEDIF(I9,NOW(),"ym")&" months, "&DATEDIF(I9,NOW(),"md")&" days"))
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Hiding an unintended value

On Thu, 18 Jan 2018 17:52:08 +0000, jshaner69
wrote:


if I9 does not have a date then J9 read "118 Years, 0 months, 18days and
I want it to be blank. Any help would be greatly appreciated. I tried
the basics but then just a FALSE reading.

J9 Formula: =IF(K9<"","Placed Out of Service",(DATEDIF(I9,NOW(),"y")&"
years, "&DATEDIF(I9,NOW(),"ym")&" months, "&DATEDIF(I9,NOW(),"md")&"
days"))


In Excel for Windoze, a cell formatted as type=date and blank will
have a date of ZERO. That is 1/1/1900.

Suggest your expression includes a test for I9=0.
  #3   Report Post  
Junior Member
 
Posts: 16
Default

Worksheet function can't judge whether it is a date.
VBA function:
isdate()
When it's a date, it returns true, or it returns false.
  #4   Report Post  
Junior Member
 
Posts: 2
Default Hiding an unintended value

Thank You for your help, it is greatly appreciated. I will try this solution and see if I can make it work.
  #5   Report Post  
Junior Member
 
Posts: 16
Default

Your worksheet function I'll not modify.
I give you the VBA function to judge if it is a date.
If it is a date, it will return true, otherwise it will return false.
The function DateJudge have 2 parametres
ra is a cell address, iyear is a condition that you can modify when the year =iyear, it can be recognized as a date.

Function DateJudge(ra As Range, iyear As Integer)
DateJudge = False
If IsDate(ra) Then
If Year(ra) = iyear Then DateJudge = True
End If
End Function
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unintended line connecting two data points EleanorPeregrine Charts and Charting in Excel 0 October 5th 12 10:22 PM
unintended format changes Excel 2007 Excel-man Excel Discussion (Misc queries) 3 November 13th 08 03:48 AM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Hiding Column Also hiding text Cindy Excel Programming 0 April 6th 06 07:18 PM
#DIV/0! hiding GJR3599 Excel Discussion (Misc queries) 0 March 9th 05 07:54 PM


All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"