if statements

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

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

If statements

resolvedResolved · Low Priority · Version 2003

Christina has attended:
Excel Advanced course
Excel VBA Intro Intermediate course

If statements

Please can you help me. I am trying to write a formula to say the below:

If cell Q2 is greater than 31/12/2010, then say "No 2010 loan", if not then ""

The formula I used is =IF(Q2>31/12/2010,"No 2010 loan","")

Q2 is a date and formatted as 01/08/2010

For some reason this is not bringing through the correct value, any suggestions??

Thank you

Christina

RE: If statements

Hi Christina, thanks for your query. Try this:

=IF(A2>40543, "No 2010 loan", "")

Excel doesn't "see" dates, it only sees a numerical number. If you format 31/12/2010 as a number it's actually 40543, hence the formula above. You can keep Q2 formatted as a date for the users benefit, but your formula needs to test the numerical equivalent of the date, not the date formatted version.

Hope this helps,

Anthony


 

Excel tip:

Sorting data stored in rows

Primarily Excel is set up to sort data that is stored in columns rather than rows.

It is possible to get Excel to sort data stored in rows however.

Click in the row you want to sort, or select the cells in the rows you wish to sort.

Go to Data - Sort, then go to the Options button in the bottom left corner of the Sort dialogue box.

View all Excel hints and tips


Server loaded in 0.33 secs.