?
Solved

Problem with IF statement

Posted on 2013-06-06
3
Medium Priority
?
217 Views
Last Modified: 2013-06-06
The below IF statement is not working as I need it to be

=IF(H2<10/29/2012,"Pre","Post")

What I need to do is check the date in H2 and if it is less than 10/29/2012 then return Pre, else return Post.
The date formating for H2 = xx/xx/xxxx
0
Comment
Question by:Frank Freese
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 1000 total points
ID: 39225485
10/29/2012 won't be recognised as a date like that,  try either

=IF(H2<"10/29/2012"+0,"Pre","Post")

or better to use unambiguous DATE function like this

=IF(H2<DATE(2012,10,29),"Pre","Post")

regards, barry
0
 
LVL 1

Accepted Solution

by:
Teknodok earned 1000 total points
ID: 39225502
=IF(H2<DATEVALUE("10/29/2012"),"Pre","Post")
0
 

Author Closing Comment

by:Frank Freese
ID: 39225535
both great answers
thank you
0

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question