DEV Community

Azad Kshitij
Azad Kshitij

Posted on

1

Lookup in 1 min

This is a handy function when you need to look up something quickly and easily.

LOOKUP has two forms: vector and array. The vector form is simpler and more common, so I'll focus on that one. The vector form of LOOKUP has three arguments:

  • lookup_value: This is the value that you want to find in a row or column. It can be a number, text, a logical value, or a reference to a cell.
  • lookup_vector: This is the range that contains the values that you want to match with lookup_value. It can be a row or a column, but it must be sorted in ascending order.
  • result_vector: This is the range that contains the values that you want to return from the same position as lookup_value. It can be a row or a column, but it must be the same size as lookup_vector.

For example, let's say you have a table of products and prices like this:

Product Price
Apple $1
Banana $2
Cherry $3
Date $4
Eggplant $5

If you want to find the price of a product, you can use LOOKUP like this:

=LOOKUP("Cherry",A2:A6,B2:B6)

This formula will return $3, because "Cherry" is in cell A4, and $3 is in cell B4.

You can also use LOOKUP to find the product name for a given price, like this:

=LOOKUP(4,A2:B6,A2:A6)

This formula will return "Date", because 4 is in cell B5, and "Date" is in cell A5.

That's it for this blog post. I hope you learned something new about LOOKUP in Excel. If you have any questions or comments, feel free to leave them below. Thanks for reading!

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay