if function not working

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 function not working.

IF function not working.

resolvedResolved · High Priority · Version 2003

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

IF function not working.

Hey

I have a bit of a problem with my If Function.

I have two dates in two seperate colums. in the format dd/mm/yyyy. The columns are W and Q.

I have input an If Function along the lines of =If (W2=Q2), "", "Re-allocate"

The problem i'm having is that when the two dates match in both columns the formula is still returning "Re-allocate".

I think the problem might lie with the formatting of column Q. The date shown is the date retrieved from a vlookup function, from another sheet, that includes a time of day as well such as 00:00:00. The v lookup is only returning the date however.

Any thoughts as to why this is not matching? or Excel not recognising the two as the same date?

Thanks

RE: IF function not working.

Hello Gareth

Thank you for your question.

Would it be possible for you to email in a copy of the spreadsheet (or a similar example), including the sheet that the vlookup data? If so please email to amanda@stl-training.co.uk


Kind regards
Amanda

RE: IF function not working.

Thanks amanda. Example Copy sent.

RE: IF function not working.

Hello Gareth

Thank you for sending through the spreadsheet.

I don't think that the problem lies in the formatting, I think it is to do with the fact that you are getting Excel to try and compare something that is a value (the date in column A) with something that is the result of a formula (the result of the lookup in column C) - you're not comparing apples with apples here.

I tried copying the date from column C and pasting it as a value in a different cell, and changing the IF function and then it worked. I can't think of an easy solution for this, but I hope this helps to explain why the formula isn't working as you expect.


Kind regards
Amanda

RE: IF function not working.

Thanks Amanda

Im a bit confused by this one as it worked with the formula result and text date comparison yesterday!

I amended the tab the vlookup was collecting the data from this morning and now it no longer works!

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Date and time

CTRL+ SEMICOLON then SPACE then CTRL+SHIFT+ SEMICOLON

View all Excel hints and tips


Server loaded in 0.09 secs.