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

if statements

ResolvedVersion 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:

Display developer tab - Excel 2010

a. In Excel, click on the File tab
b. Select Options from left hand side
c. Choose the Customize Ribbon section
d. Click the box next to Developer in the list of tabs on the right hand side of the dialog box. When ticked the Developer tab will be visible.
e. Click OK to apply your changes

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.