Urgent.News

What's breaking now, across hundreds of outlets.

Tech

VLOOKUP is not broken: why it says #N/A when the value is right there

You can see the value. It is on row 412 of the price list. You typed it into the formula. And Excel still answers #N/A. This is the most common spreadsheet support question there is, and almost every time the answer is the same: the two cells are not equal. They look equal on screen. They are not equal to Excel. The formula is fine; the data is lying to you. Below is what #N/A actually means, the…

When VLOOKUP returns #N/A, despite the value appearing to be present, the issue often lies in the cells not being equal. This can occur due to several reasons. The first cause is when a number is stored as text. This is particularly common when data comes from an external source like a CSV export, PDF copy, or manually typed data.

Despite appearing identical, text-formatted numbers and actual numbers do not match in an exact lookup. This discrepancy can be identified by using formulas like =ISTEXT(A2) or =ISNUMBER(A2) to check if the cell is text or a real number, respectively. If the formula returns TRUE that the cell is text, the issue lies here. The remedy is to correct the source data or convert the text to numbers using Excel's Power Query feature or within the formula itself using functions like VALUE or multiplication by 1.

The second cause is invisible characters. These can sneak into text from web pages, emails, or formatted reports and include trailing spaces or non-breaking spaces. These spaces are not visible but can affect the comparison in VLOOKUP. Diagnosing this issue involves using functions like =LEN(A2) to compare the length of the text with a known clean cell or =CODE(RIGHT(A2,1)) to detect the type of space character present.

The fix involves cleaning the lookup value using functions like TRIM and SUBSTITUTE to remove unwanted spaces. The third cause is genuinely different values. This is less common but can happen when leading zeros are dropped, different date formats are used, or rounding discrepancies exist. For instance, an account number stored as text with leading zeros may differ from the same number stored as a real number.

Another possibility is a difference in date formats or rounding. The resolution involves comparing the cells directly using =A2=B2 and checking the data types using =ISTEXT() and =ISNUMBER(). Additionally, checking the length of the text values with =LEN() can reveal hidden characters. Ensuring that the lookup range starts at the correct column and that absolute references ($ anchors) are correctly applied is also crucial.

Sometimes, overlooking the match argument in VLOOKUP can lead to approximate matches on unsorted text, resulting in incorrect answers. To prevent future occurrences of #N/A, always include the fourth argument (FALSE for exact match) in VLOOKUP formulas. On import, type the key columns correctly and set column types in Power Query to ensure consistency.

Lastly, using a helper column for cleaned values can help in auditing and simplifying the process. Following these steps can significantly reduce the occurrence of #N/A errors in spreadsheets.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Get the news by email. Yesterday's most-covered stories, every morning.

See today's edition · More options

More in Tech

One YAML file is your architecture: assembling a production-grade Go microservice from config alone

In my last post I introduced the architecture behind GoWind — the framework that carries 20+ enterprise products on a single Go stack: a core under 500 lines, 130+ plugins, and assembly by…

  • One YAML file defines entire microservice architecture in GoWind
  • Demonstrates HTTP and gRPC microservice with multiple components
  • All infrastructure defined declaratively in YAML configuration

Write a custom middleware plugin for a 500-line Go framework (complete walkthrough)

This is part 3 of a series on GoWind , the framework behind our 20+ product suite: The building-block architecture — a core under 500 lines, 130+ plugins One YAML file is your architecture…

  • 500-line middleware plugin for GoWind framework
  • Supports HTTP/gRPC/DB/cache/tracing via YAML config
  • IP blocklist configured through YAML with CIDR ranges

More from Sunday, 6 December 2026 →