excel if statements
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Excel IF statements

Excel IF statements

resolvedResolved · High Priority · Version 2007

replyReply Fri 21 Oct 2011, 10:44Delegate Lisa said...

Excel IF statements

Hi, having a problem with IF statements and dates

In column “D2” I have a date say 21/10/11, in column “E2” I want to return the words “Working After 24th Dec 2011 else “Left before 24th December 2011”.
I wrote the following IF statement
=IF(D2>=24/12/2011,"Working After 24th Dec 2011","Leaving Before 24th Dec 2011")

But all columns say “Working After 24th Dec 2011” even those that have an end date before 24th Dec. What have I done wrong? What should the statement be?

Thanks in advance for your help. Lisa

For upcoming training course dates see: Pricing & availability

replyReply Fri 21 Oct 2011, 12:29Trainer Simon said...

RE: Excel IF statements

Hi Lisa,

Thank you for your question.

Please find the following formula using the DATE function where you specify the Year, Month, Day in the Logical Test.

=IF(D1>=DATE(2011,12,24),"Working After 24th December","Leaving before 24th December")

I hope this makes sense and answers your question.

Let me know.

Regards

Simon

replyReply Fri 21 Oct 2011, 13:44Delegate Lisa said...

RE: Excel IF statements

Hi Simon, I coped your statement exactly and this statement also returns an answer of "Working After 24th December 2011" when the date in D1 is before 24th Dec.. could this be because the date in your formular is in USA format and my date is in UK format? I have tried to change the date in the formular to mirror UK date format DD/MM/YYYY but I cant work out how to do that..

replyReply Fri 21 Oct 2011, 14:26Trainer Simon said...

RE: Excel IF statements

Hi Lisa,

Thank you for your response.

Are your dates in american or UK format?

I have attached a spreadsheet showing you my formula and the dates are in UK format. If the date is >= 24/12/2011, it returns 'Working After 24th Dec 2011'

Have a look at my spreadsheet and can you please confirm this is the result you were looking for.

Regards

Simon

Attached files...

Formula.xlsx

 

Please browse our web site to find out more about
microsoft+excel+training+course and other Microsoft training courses.

Excel tip:

Multiple Lines of Text in a Cell

As an alternative to the Text Wrapping facility, type a word or two, press Alt+Enter to get a new line, type more text, and continue the process for as many lines as you need. Enter as normal when you have finished.

The line break is not affected by changing the column width, as text wrapping. To remove this you must edit the cell and remove the invisible character and replace with a normal space.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard