[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
Solved

Simple IF statement???

Posted on 2012-08-23
Medium Priority
387 Views
Experts,

It should be simple, but its not working and even when I search on "multiple IFs" and try using / tweaking, still not working using OR or AND in the IF.  Maybe its a sequence of order?

This is what I need
cell F2 has either a date, or is blank
if F2 <1/1/2012, then Y
if F2 is blank, then N
if F2 is > 12/31/2011, then N

Need quickly (sorry)
0
Question by:AliciaVee
• 4
• 2
• 2

LVL 33

Expert Comment

ID: 38325609
=IF(F2="","N",IF(F2<DATE(2012,1,1),"Y","N"))
0

LVL 33

Expert Comment

ID: 38325642
Please take a look at the attached example...
Simple-IF.xlsx
0

LVL 43

Expert Comment

ID: 38325656
=IF(AND(F2<>"",F2<40909),"Y","N")
0

Author Comment

ID: 38325680
I tried all 3 examples, in the order that they were posted, and each one has the same issue in that when the date is 12/31/2011, the result should be N, but each is returning Y -- why is that? Help!
0

LVL 33

Accepted Solution

jppinto earned 2000 total points
ID: 38325723
=IF(F2="","N",IF(F2<DATE(2011,12,31),"Y","N"))
0

LVL 33

Expert Comment

ID: 38325733
Please check the attached file with the various options as examples for you to see the result of the formulas.

jppinto
Simple-IF.xlsx
0

LVL 43

Expert Comment

ID: 38325750
I get an N. See attached.
Simple-if.xlsx
0

Author Comment

ID: 38325797
jppinto -- works!  thanks!!!
0

Featured Post

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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 how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Suggested Courses
Course of the Month19 days, 16 hours left to enroll