#N/A error with Match using a Named range

CamaDragon 90 Reputation points
2026-12-01T17:48:31.81+00:00

Here is my formula: =MATCH(A127,Fundbud,FALSE). It works fine when A127 is mainly numbers (ie 111.1111), but if it has text (ie AAA.BBBB) then it returns #N/A. Named range Fundbud is in a different worksheet, same workbook. I have tried trimming the column in Fundbud (Col B) and then copying back as values. If I refer to the actual column (i.e B43:B200) then it works fine.

Any ideas on a fix for this? I prefer not to use the column reference since it may be expanding (although I think I can change this through an OFFSET). The named range Fundbud is already using an OFFSET function.

Thanks

Microsoft 365 and Office | Excel | For home | MacOS
0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-12-01T17:49:25.0566667+00:00

    Change the Fundbud definition so its height uses COUNTA, not COUNT; COUNT excludes text such as AAA.BBBB, which can cause an OFFSET-based name to stop before those entries even though a direct range works.

    Correct the named range

    1. In Excel for Mac, open Formulas → Name Manager.
    2. Select Fundbud and inspect Refers to.
    3. If its OFFSET height contains something similar to:
         COUNT(Data!$B$43:$B$200)
      
      replace it with a text-aware definition such as:
         =OFFSET(Data!$B$43,0,0,COUNTA(Data!$B$43:$B$1048576),1)
      
      Replace Data with the actual worksheet name. This assumes the Fundbud list begins at B43 and has no blank cells within it.
    4. Keep the lookup formula as:
         =MATCH(A127,Fundbud,0)
      
      FALSE and 0 both request an exact match. MATCH supports text lookup values and returns #N/A only when it cannot find the value in the range it was given.^1^

    OFFSET returns only the range described by its starting reference, height, and width.^2^ Therefore, if the calculated height counts only numeric cells, the named range can omit text records even though those records are visible in column B.

    Prefer a nonvolatile definition

    OFFSET is volatile, meaning Excel recalculates it at every recalculation. Microsoft recommends an INDEX-based dynamic range where practical.^3^

    For a contiguous list beginning at B43, use:

    =Data!$B$43:INDEX(Data!$B:$B,ROW(Data!$B$43)-1+
     COUNTA(Data!$B$43:$B$1048576))
    

    Enter that as one line in Fundbud → Refers to. This also assumes there are no internal blanks.

    If the name already uses COUNTA

    Verify that the name actually includes the problem cell:

    1. Open Name Manager and select Fundbud.
    2. Inspect the evaluated range shown in Refers to.
    3. Confirm that its first and last rows encompass the cell containing AAA.BBBB.
    4. Check that the definition returns only column B and does not accidentally start in or offset into another column.

    Since trimming has already been performed and the direct B43:B200 reference succeeds, repeating the cleanup is unlikely to help unless the text lies inside the evaluated named range and still fails. In that narrower case, compare the lookup value and source cell’s data types; hidden characters and type mismatches are documented causes of #N/A in exact matching.^4^

    More maintainable alternative

    Convert the source list to an Excel Table and use its structured column reference. Tables automatically expand and contract as rows are added and generally have fewer performance disadvantages than volatile dynamic names.^3^

    For example, if the table is named BudgetTable and its column is Fundbud:

    =MATCH(A127,BudgetTable[Fundbud],0)
    

    References

    1. MATCH function | Microsoft Support
    2. OFFSET function | Microsoft Support
    3. Excel performance: Tips for optimizing performance obstructions
    4. How to correct a #N/A error in INDEX/MATCH functions | Microsoft Support
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.