Share via

Match Function Returning #N/A

Anonymous
2019-06-17T22:38:06+00:00

I am in process of writing some VBA code to find which column a specific header is in, so that I may further process the contents of that column.  Problem is that in many cases, where I am executing this against the Header row ( a defined range), if finds SOME of the headers and cannot find others.  

SO, I thougth I would do an experiment with a simple Match function.  Surprisingly, the results were identical to the VBA Code.  I believe if I can make the MATCH function work (finding why it is not) then my VBA code will also work.

In the image below, you can see where I have supplied the formula used by each of the cells in Column K, using the associated match formula.  Note how looking for "Decom Driver" works, but looking for Coordinator Comments does not.  This is exact same behavior I am seeing when I am searching a Range in my VBA code.  How can it POSSIBLY not be finding Coordinator Comments.  And note...i have this issue of not being able to be found on about 35% of all the column headers.  Others work perfectly.

I have run a CLEAN function and re-pasted the cleaned values into the headers, but no difference, thinking that there may be a spurious character not visible, in the header.  But problem persists.  Ideas?  Seems like some sort of "bug" but I won't assume that, for now.

Thx!

PK

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2019-06-18T00:05:05+00:00

When a MATCH() failed to find the Lookup_Value (What you are looking for) in Lookup_Array (Data Range) then it returns #N/A Error.

So, I'm 100% sure that your Lookup_Value is not present EXACTLY in lookup data range.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-06-18T00:37:58+00:00

    Truly...I have to agree with you all...been doing this for a long time.  But here's something interesting...i emailed the file to myself, at home, and opened the file in excel on my personal system.  WORKS PERFECTLY as expected.  Go figure.  So something "odd" with my work PC version of excel (I think).

    Work PC is office 365, and my home PC is my own personal Office 2016 version of excel.

    This is crazy.

    Maybe I need to re-install on work PC

    Thanks all

    Pk

    Was this answer helpful?

    0 comments No comments
  2. Ashish Mathur 101.9K Reputation points Volunteer Moderator
    2019-06-17T23:57:20+00:00

    Hi,

    Share the link from where I can download your workbook.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-06-17T23:50:38+00:00

    Yes... We have long since eliminated spelling, etc. We even had a second person create a, stand-alone new workbook, telling him what headings to use (no copy paste). Identical results. 

    And as I noted in post, we had already used the Clean function as well, to ensure no spurious character. 

    So while I would have to agree with you in principle, the actual results are stating otherwise.

    Was this answer helpful?

    0 comments No comments
  4. Ashish Mathur 101.9K Reputation points Volunteer Moderator
    2019-06-17T23:17:47+00:00

    Hi,

    This problem 100% arises only because of spelling differences/extra spaces.  Recheck.

    Was this answer helpful?

    0 comments No comments