Kris
Kris

Reputation: 45

Excel IF AND statement returning false when true

I have a formula that is supposed to check if two statements are true: that the name shows up corresponding with a certain date. If true return the word YES, and if false return the word NO.

For some reason the formula provides the correct answer in some cases and the wrong answer in others and I can't figure out where I am going wrong.

The statement is as follows:

=IF(AND(Transfers!$A$2:$A$500=$B$2,Transfers!$B$2:$B$500=A3),"Yes","No")

Transfers is just the name of the tab where it's searching for the criteria.

For some reason some provide YES as it should and other provide NO when it should be YES. Anybody have any idea what I'm doing wrong?

Upvotes: 3

Views: 3612

Answers (1)

UndeadBob
UndeadBob

Reputation: 1129

Make sure your dates are really dates... see this answer on bad formatting.

If that's not it, just be careful when calculating dates... see this answer on calculating dates.

I'd bet the latter. Excel is very picky about exact matching like your trying to do ... As an extreme, you could google "fuzzy lookup", but I think that's overkill for your application.

Upvotes: 1

Related Questions