If statement with non specific date

  • Thread starter Thread starter Eric D
  • Start date Start date
E

Eric D

Hey guys/gals,

Can anyone tell me if you can use an IF statement so that it recognizes a
non specific date.

for example: D1 has 6/11/08
I want to enter an IF statement so that if at any time column D has a date
then it will say "package made" in column E right beside the date.

Any suggestions?
 
If the cell in column D will be either blank or have a date:


E1: =IF(D1<>"","package mode","")
 
No it will not always be blank, but the only time a date appears i want it to
perform the function.
 
you can also try

=IF(OR(N8<21916,N8>42005),"bad","package made")

This should put package made if the field has a date between 1/1/1960 and
1/1/2015 which is hopfully my retirement date. All letters should mark it as
bad which you can change to blank
 
The problem is that a date in Excel is merely a different way of formatting
a number, so if you may have other numbers in that column you need to find a
way of distinguishing your "dates" from other numbers. If the dates don't
include times, then they will satify =MOD(A1,1)=0, but of course so will any
integer numbers. If your dates are over a relatively limited range of time,
then you can include that in your constraints. But if you have one cell
with 12 Jun 2008 (as a real date, rather than text), and another cell with
39611, they will contain the same value. You might choose to use
=CELL("format",A1) to tell you which format is in use, which might be an
additional help.
 
Cool thanks David.

As I am not that excel advanced can you show me how this would look in the
IF statement?

There would never be an occasion that there would be other numbers in the
cell other than a date.
 
Put this function into a regular module and refer to it

Function isd(x)
If isdate(x) Then isd = True
End Function

=IF(isd(H2),"Pm",2)
 
If there would be no numbers other than dates, the easy option is
=IF(ISNUMBER(A2),"package made","")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top