VLOOKUP stands for vertical lookup and we can use to scan a column and get matching data. In this article, learn how to use VLOOKUP with 10 practical examples. You also get a free sample workbook to practice VLOOKUP.
Table of Contents
What is VLOOKUP?
VLOOKUP stands for Vertical Lookup. We can use it scan your data to find a matching value.
You can use the below syntax to write VLOOKUP.
'SYNTAX
=VLOOKUP(search_value, in_this_data, return_column_number, approximate_match_ok?)
- Search_value: this is the first parameter or option for VLOOKUP. You can specify the lookup value here. It can be a typed-in value or reference to a cell value.
- In_this_data: This is where your data is. It can be on the same worksheet or in another tab. It can be a range of values (like B5:E17) or a table (like tblSales).
- return_column_number: This number tells VLOOKUP which column to extract after the result is found. Refer to below examples to better understand this.
- approximate_match_ok? This TRUE / FALSE setting tells VLOOKUP if you want an approximate or exact match for your search. In 99% of situations, I use FALSE for this, as we need EXACT matches in business situations.
VLOOKUP Explanation
Here is a simple VLOOKUP to get the sales value of Josh from my sales data in the range $B$5:$E$17. The formula returns the result of $1680.
Refer to below image to understand the concept of VLOOKUP.
'SYNTAX
=VLOOKUP(search_value, in_this_data, return_column_number, approximate_match_ok?)
'EXAMPLE
=VLOOKUP("Josh", $B$5:$E$17,3,FALSE)
'RESULT
1680
EXPLANATION
Vertically looks up “Josh” in column B of the range B5:E17 and returns the exact matching value from column D (3rd column from B). Refer to the above picture and syntax to understand the concept.
VLOOKUP - 5 Essential Examples
Now that you understand the concept of VLOOKUP, let’s look at 5 essential examples of this lookup function in day-to-day business settings.
Note: All these examples use the same sales dataset as above. You can grab a copy of this file from here.
Example 1 - Basic Usage of VLOOKUP
The most basic usage of VLOOKUP is to lookup a value in a table and get corresponding matching value from another column.
In this example, we want to lookup sales of “Josh” from the sales data in the range B5:E17.
'EXAMPLE 1
=VLOOKUP("Josh", $B$5:$E$17,3,FALSE)
'RESULT
1680
Example 2 - Using Input Cell for Search Value
One simple way to make your VLOOKUP formulas powerful is by using input cell to maintain the search value. This way, everytime you need to search for a different thing, you just update the search value.
'EXAMPLE 2
'Put a person's name in cell G8, such as Jagjit
'Formula:
=VLOOKUP(G8,$B$5:$E$17,4,FALSE)
'RESULT
709
Example 3 - Searching by pattern (name begins with)
Many times, we don’t know what the full value is. We just know the first few letters. For example, looking at the sales data in range B5:E17, you want to find the sales of the person whose name begins with the value in cell G5.
For example, G5 contains Jav
In this case, we are looking for the person Javed.
'EXAMPLE 3
'Type Jav in G5
'Formula:
=VLOOKUP(G5&"*",$B$5:$E$17,3,FALSE)
'RESULT
$2277
How this “Name begins with” VLOOKUP works?
- The formula is =VLOOKUP(G5&”*”,$B$5:$E$17,3,FALSE)
- First let’s look at the search_value option. This is G5&”*”
- As G5 is “Jav”, this becomes Jav*
- * is a special character for VLOOKUP. It means, anything after Jav.
- So VLOOKUP looks for any name that begins with Jav and finds Javed.
- The rest is easy to understand.
POP QUIZ…
- How would you find Net Sales for the person whose name ends with sh
- Write a formula for that and share your answers in the comment section.
Example 4 - Get the entire record
Let’s say you want the entire record, not just Net Sales column (3). In this case, you can use an array as the 3rd parameter for VLOOKUP. See this powerful example.
'EXAMPLE 4
'Get entire record for Johnson
'Formula:
=VLOOKUP("Johnson",$B$5:$E$17,{1,2,3,4},FALSE)
'RESULT
The entire row of values for Johnson
Johnson 10 $1,540 $570
Note about using this formula:
- If you have Excel 365 or using Excel on the web, the above formula works as is.
- If you are using any older version of Excel (such as Excel 2016 / 2013 / 2010), then you should do the below steps:
- Select a range of 4 cells for your result.
- Type the formula in the very first cell.
- Then instead of pressing ENTER, press CTRL+SHIFT+ENTER
Example 5 - When VLOOKUP can't find the value...
Life would be just awesome if we can always find what we want. Sadly, that is not the case. So what happens when VLOOKUP can’t find the value you want to look for?
It will return an error. #N/A error.
See below example. Read on to learn how to fix the problem.
'EXAMPLE 5
'Looking for an non-existent value
'Formula:
=VLOOKUP("Chandoo", B5:E17,2,FALSE)
'RESULT
#N/A
How to fix the #N/A error in VLOOKUP?
We can use the IFERROR function of Excel to handle errors with our VLOOKUP FORMULAS.
For example, you can use this formula to show a message like “Person not found” for the Example 5 above.
'EXAMPLE 5 with error handling
'Looking for an non-existent value
'Formula:
=IFERROR(VLOOKUP("Chandoo", B5:E17,2,FALSE), "Person not found")
'RESULT
Person not found
How to use VLOOKUP when you have data in a table?
VLOOKUP works great with data in tables or regular ranges. I prefer using VLOOKUP with table data as tables are easier to manage business data.
Related: Learn how to create and use Excel Tables.
Here are 3 examples of using VLOOKUP with CTRL+T Tables in Excel.
'VLOOKUP TABLE EXAMPLES
'Data is in table named tblSales
'Formula:
=VLOOKUP("Josh",tblSales,3,FALSE)
'Result:
$1680
'Formula
=VLOOKUP(G37,tblSales,3,FALSE)
'Result
$1799
'Formula
=VLOOKUP(G41&"*",tblSales,3,FALSE)
'Result:
$2277
Learn more about tables in Excel:
- Tables are a very powerful and time-saving feature of Excel. Please refer to below articles to learn more.
- How to create and use tables in Excel
- Tables + VLOOKUP examples
VLOOKUP - Video Tutorial
Please refer to below video tutorial to understand how to use VLOOKUP.
Download VLOOKUP Examples - Workbook
Please download the sample workbook for this article and learn how to use VLOOKUP quickly.
What are the limitations of VLOOKUP?
While VLOOKUP is a game changer when it was originally introduced, when you look at the data challenges we all face in 2024, it suffers from many limitations. Here are the main downsides of using VLOOKUP.
- It can only lookup on the left-most column: VLOOKUP can only search on the data in left-most column of the table and return values to the right. So, if you want to find out the sales person’s name who has sales of $2,133, we can’t do that with VLOOKUP.
- We can use INDEX+MATCH or XLOOKUP (my preference) to solve this problem.
- Column Numbers: Let’s be real. Nobody refers to their data by column numbers. We think and memorize the data by what it is. So, if I want to lookup a name and get the corresponding sales, then I must translate the sales to column number for VLOOKUP. This is lame.
- We can use XLOOKUP to fix this problem.
- No Error handling: VLOOKUP doesn’t handle errors by itself. So if your lookup cannot find the value, it just comes back with #N/A. This often has a cascading effect on the charts, dashboards or reports you create.
- We can use either XLOOKUP or IFERROR to solve this problem.
- Approximate Trap: I can’t tell you how many times I accidentally leave the last parameter of VLOOKUP out and end up getting wrong results. This is because, if you forget to say FALSE at the end of VLOOKUP, you fall into the approximate trap. Your VLOOKUP RESULTS WILL BE WRONG.
- We can use XLOOKUP or be careful when writing VLOOKUPS.
My top 3 Alternatives for VLOOKUP
Let me be honest here. As of 2024, I no longer use VLOOKUP to solve my lookup problems in Excel. I use one of these alternatives depending on the nature of the job.
- XLOOKUP: Ever since XLOOKUP was launched a few years ago, it has become my go to lookup formula. It can do everything VLOOKUP does and adds many time-saving features.
- XLOOKUP can lookup both vertically or horizontally.
- XLOOKUP defaults to exact match all the time.
- It can lookup on any column and return another column (thus fixing the left column only limitation of VLOOKUP)
- It has built-in error handling mechanism.
- It works well with new Dynamic Array world of Excel.
- Power Query: We can use the MERGE Queries functionality of Power Query to lookup and get matching values for two tables quickly and efficiently. I mention this in my recent video here.
- Power Pivot: If you have two tables each holding one piece of a data puzzle and you want to answer business questions by combining both datasets, we can use Power Pivot’s relationship feature. This automatically connects both tables and let’s you synthesize data to answer queries. Learn how to use Power Pivot to replace VLOOKUPs.
In conclusion: Should you learn and use VLOOKUP?
As mentioned above, I no longer actively use VLOOKUP for my lookup problems. That said, it is a very useful formula and I recommend everyone to learn the basic syntax at the minimum.
- If you use Excel 365 or Excel on Web: Focus on learning XLOOKUP instead.
- If you also work in Power BI: Learn how to use Power Query and Power Pivot to replace LOOKUPS in your data.
- If you work with older versions of Excel: Then VLOOKUP is a must for you. Learn and use it well.
More information on VLOOKUP
Check out below resources and help to learn more about VLOOKUP and alternatives.












70 Responses to “10 Tips to Make Better and Boss-proof Excel Spreadsheets”
Proper print settings on each sheet helps your boss to print the reports quickly without hastling you after printing irrelevant stuff.
It is highly relevant that you print your reports once before circulating it to your boss or other people.
Knowing that what your boss actully look at in the entire report can be very usefull. You can build a good summary of what your boss wants and put that as separate tab in the form of dashbord report, so that your boss does not peep into rest of your work and start pocking you with irrelevant stuff.
You can also put that Dashboard into the email summary and not trouble your boss to open your workbook. This is ultimate boss proof tip and I have been using this for long time now.
Thank you Chandoo. Great checklist to follow before delivering an excel spreadsheet to someone else. Some points you mention are seemingly so simple that we might overlook them - like selecting cell#A1, but they make a difference to the impression the spreadsheet creates at the recipient's end.
Dear Chandoo,
Great tricks.
One trick I use (more and more) is to hide the sheet tabs and to hide the formulabar via the 'tools' 'options' and the 'view'-tab.
Another trick is to limiting the scrolling area to hide all columms (or rows) until the end of the sheet. Select the column, press CTRL+SHIFT+RIGHT, right-click on the column and hide (also possible via VBA).
I was wondering though if 'boss-proof' is related to 'excel-stupid-proof'?
Cheerio
Tom
Just wondering if the hiding formula bar really works when a recipient opens it whose "view-show-Formula Bar" is still checked...
It's saved to the sheet I believe.
Absolutely agree with this post !!!
on the past months, after reading this blog, PTS's and Debra's Contextures, one of the things I've beggining to do as a best practice is to create all my spreadsheets with 3 tabs: data, summary and control, and this last one generally xlveryhidden, and sometimes the data one hidden as well.
And this restrictions are also being applied as best practice, and with a lot of benefits as you well mentioned. Furthermore, if combined with dynamic named ranges, formulae is more readable to users, and the WOW effect is often achieved when the question "How did you do that?" arises.....
Keep on the good posts !!!
Rgds,
Martin
Would you mind sharing an example of this technique?
Is there a way to keep the data in a seperate file rather than the same excel. This way you could keep presentation and data separate. But not sure how you would link up the two excel files
Yes, there is a way but it is not prefered.
I used this a coulple of times, (You need to code).
mail me if you need assistance with some sort
It entirely is possible. The problem comes though, when you share the spreadsheet.
If the recipient doesn't have both files, or access to both, things break when the values try to refresh.
ey, why is the boss a she??
haha - welcome to the future. About time.
Chandoo, one more trick that we could use with the help of VBA, RT click on the View code of the particular sheet, in the properties table set the Visible status to 2-xlveryhidden, this ensures the sheet name does not show up even when the BOSS tries to unhide the sheet from the sheet >> unhide option. Dont forget to password protect the VBA (available under tools >> VBAProject properties.
Very good tips, although I have to say Chandoo, that your cats probably need to be spayed or neutered if they behave like that. =)
Good to see all these tips on a single "sheet", and giving the name *boss proof*, and Dilbert was a great welcome 😀
The best way to "Boss Proof" (and "Self Proof"!!) a spreadsheet is to keep back ups. I use a macro that saves the last 3 significant versions of the spreadsheet all with a date stamp included in the file name.
To quickly select cell A1 on all sheet, use CTRL-Page UP or CTRL-Page down to navigate between sheets and CTRL-Home to select cell A1 (if you have frozen pane, it will select the top left cell of the section below).
Great list. And I follow every single item... I also use a consistent background color for input cells in every report/dashboard. And I use a little VBA to identify the user and change the report accordingly (selecting the right market, for example).
Chandoo, Nice post. I like to use the hidden Paste Picture Link option. Keep the original report you want displayed on a hidden sheet and only show the boss the report picture. Also great to watch the confusion when boss trying to select cells is worth the effort!
I usually save as PDF if there's no interactivity in the report. That way nothing can go wrong 🙂
PDFs work a dream for me too and saves the boss's EA from telling me all the time that she can't print my work!!
@All.. thanks a ton for sharing your ideas. I am thinking of writing a part 2 of this post explaining some of your ideas in detail.
@Bazlina ... I will make sure the boss is a HE in the next post 🙂
"10 Tips to Make Better and Boss-proof Excel Spreadsheets"...
Unless of course your Boss reads PHD !
Great article with one glaring error.
If (like me) the majority of your spreadsheet errors are *caused* by cats, adding more cats is just going to increase the problem.
@Hui you always have a boss, even if you are boss. If you dont have a boss, then may be a cat or even a dog.
@Debra: hmm... Are you sure the cats are not after the mouse? Go learn some keyboard shortcuts.. now 😛
Great Web Site. I've done almost all the above in trying to build my application and it's taken me hours and hours reading my "dummies " book. Thank you for all this information.
Is there a formula I can use that will automatically return to "A1" cell should an associate use the 10 page spreadsheet I have?
Is there a way to set an expiration date on my workbook so that beynd that date no one will get beyond the cover page?
Paul, in all my "user facing" workbooks (those that I distribute) I create a named range called "Home" on the worksheet(s) that are most likely to be used. Then I write a little VBA that selects the Home range whenever that worksheet is activated or on other triggers depending on the context of the sheet. This is more appropriate for the dashboard tabs or summary tabs my job requires.
But I usually set this functionality up early on in the design process so I can take advantage of it as well. I will sometimes assign a keystroke to the GoHome macro.
I'm in the marketing department (aka the picture department) and have to say that the macros/Excel sheets from our controlling department are the worst! They come to me to sort out the mess!!
@Peter: You can try creating a table of contents and then place it on each and every sheet so that user can jump to anywhere from anywhere. Here is a tutorial to help you get started.
Also, You can prevent users from accessing the workbook after a certain date using macros. But users can certainly by pass it by disallowing macros on that workbook.
@Jimmy: Wow... (just kidding) Welcome 🙂
I was recently given a spreadsheet to improve upon.
One of the "boss-proof" actions that the previous author had used was to use data validation instead of protecting the sheet to ward off people changing formulas.
After entering a formula or value into a cell, use data validation to only allow, in this spreadsheet, whole numbers between 9999999 to 99999999.
It's a bit of a pain to actually correct stuff instead of just unprotecting a sheet, but for those that know how to unprotect a sheet, it's a definite way to keep them from fooling with formulas.
Puchu,
We would love to see "Print" in your links section.
It helps us taking prints as neat as your posts 🙂
Chandoo,
I've emailed you a couple of times looking for avenues I need to try to put my workbook on the Internet.
I notice you use PremiumThemes for your Web Site...You must feel good about their service. Do you think PremiumThemes might be an option for me?
Paul
Instead of :
Now Right click and select “Hide” option.
Shortcut can be used : Ctrl+0 (to hide)..
sir i wanted to know,how to hide cells or tab without hiding rows and columns? PLZ TELL ME
Hi Chandoo!
Great tips! Im researching on an excel project now that you can create to "lighten" the size without sacrificing the data inside..
We usually encounter problems with the data, excel file is shared, in a network folder.. and there are 11 people that enters their own productivity in each tab.. however, there comes a time (uncertain) where some of the data they enter either gets deleted or changes value.. could this be a file size problem? are there other ways to create this file that will decrease data inconsistencies?
thanks!
[...] Hide un-necessary rows to create clean looking workbooks (and 9 more tips) [...]
[...] Presentation format: all spreadsheets, should be designed so that it is easy to follow the process flow and result. Almost every spreadsheet should be presentable and understandable to senior management without additional formatting or explanation. (tips: how to design boss-proof excel sheets) [...]
[...] on Excel formatting here: How to make better excel sheets, Formatting [...]
[...] on Excel formatting here: How to make better excel sheets, Formatting [...]
[...] 10 Tips to make better & boss-proof spreadsheets in Excel [...]
You will find another quick and easy technique here:
http://www.onsitetrainingcourses.com.au/main/page_blog_hiding_most_excel_rows_and_columns.html
[...] tips: Learn how to make better Excel sheets Spread some love,It makes you awesome! [...]
Save what you want the boss to see as a PDF. Absolutely foolproof and no cats hurt in the process.
I really enjoyed allot of the tips on here, especially the one on comments on cells. That will come in handy on allot of our projects. I would also like to share on on my little tricks. I am constantly working on several different reports with several different systems and in doing so I am constantly running in problems and my way out of them is simply calling <a href"http://www.reportingguru.com/"> Reporting Guru </a> and telling exactly what I'm going through and they can tell me exactly how to get out.
One of the things I've found to boss proof my worksheets are a few simple VBA scripts to automatically protect the workbook/worksheets, and direct them to the "Quick Look" dashboard page, I hide all of the raw data sheets before saving. The script looks like this:
Private Sub Workbook_Open()
Sheets("Summary").Protect Password:="password"
Sheets("Labor Cost by Site").Protect Password:="password", AllowUsingPivotTables: =true
Sheets("Labor Cost by month").Protect Password:="password"
Sheets("Quick Look").Protect Password:="password"
Sheets("Quick look").Activate
ActiveWorkbook.Protect Password:="password", Structure:=True, Windows:=False
End Sub
I also have a pivot that contains labor cost data which cannot be refreshed while the worksheet is locked.
Private Sub Worksheet_Activate()
Sheets("labor cost by site").Unprotect Password = "password"
Set pvttable = Worksheets("labor cost by site").Range("a1").PivotTable
pvttable.RefreshTable
Sheets("labor cost by site").Protect Password = "password", AllowUsingPivotTables:=True
End Sub
OPPAN GANGAM STYLE!
good
Your post are always with something creative , thanks for sharing this information , your post are worth reading and implementing 🙂 great job
Hi,
I will try to learn every point slowly !
Shokran Chandoo.
Best boss Proofing of sheets is useing indirect(address 😛 this prevents most smartass bossess from doing any actual changes cus the formula will be long and hard to understand for any bystanders..
Also putting the actual calculations on a different sheet can make a sheet bulletproof from bosses.. especialy if you put them in the Very hidden so when the boss learns how to unhide sheets he wont simply find them.
One thing iv also learned is that most bosses is scared of macros that gives "virus" warnings before beeing run 😛 That include the default warning from Excel...
Long formulas or work arounds is best way to go.
What's the best way to amalgamate two existing excel spreadsheets into one?
Two teams use the same format spreadsheets with individual data split into calendar months and I want to make them one without manually entering the data.
Alt + D + D + N
Write a query and viola, Two sheets into one.
Changing the properties of the file to read-only . (While the file is closed, right click on the file and check the read-only box.)
This allows my boss(es) to access the file -- even change it -- without being able to save their changes. If a boss likes his 'new' version, he can save it with a different file name.
But now -- how to prevent the boss from deleting the file altogether? Or deleting the whole network?
Hey man.
Think you can go as easy as to make a shortcut that links to your read only document. Then the boss wont know of the root document. He can figure it out but lets face it. He is a boss and 70% if them wont know squat
Instead of "Hiding" rows & columns, I find "Grouping" works best as its very easy to quickly see if a worksheet has hidden rows/columns. Sometimes hiding a random row/column is not easily noticed and can create issues.
I have one xl sheet with different dates in many columns and one raw's. I want to send this data to another xl sheets for each date. if somebody can help me will be great.
Dear Samantha,
Check out the website of Ron de Bruin. He has a great set of macro's and free add-in that can help you with this issue.
http://rondebruin.nl/win/s3/win006.htm
Tom
Hello, I have just found out that I made a mistake in my spreadsheet: I had a column of negative numbers, but one of them was positive (while it should have been negative). Is there a formula/system to avoid this?
Thanks.
Mariateresa
Yes, data validation. Values you denote would be between -1 and -999,999,999.
Hi,
Hiding any worksheet can be unhidden and messed around easily. I change the visibility in visual basic from -xlSheetVisible to -xlSheetVeryHidden. By this, even if you right click on sheets, you will be unable to find the hidden sheets.
Cool? I think so...
Very informative, Thanks
Is there a way to lock cells in an already protected worksheet.
(Thus the entire worksheet is protected, then the entire office can open it as read only but only a few users have the password to edit the file)
I would like an additional password or prompt box so these few users don't accidentally change formulas.
Itss such as you learn my thoughts! You appear too understand
a lot abnout this, like you wrote thee e-book in it
or something. I fel that you just could do with some percent to presseure the message house a little bit,
but insatead off that, this iis wondeerful blog.
An excellent read. I'll definitely be back.
It is in reality a nice and helpful piece of info.
I am happy that you just shared this useful info with
us. Please keep us up to date like this. Thank
you for sharing.
I laughed out loud reading the 2nd solution about moving to marketing department and making ppts.
I've been using "technical" sheets for a long time already and depending on the audience it is hidden or not. I'm currently in my NO VBA mindset, so the very hidden option is no longer. Using sheets names like: TechnicalCodes; ExplicitVariables;SetUp; HeavyCalc seem to work to my experience as they send along a message "Don' t you mess-up here, you fool!". A "Read This" section or sheet however does not work!
Reading stuff on this site has helped me develop a good habit of using colors and themes to assist the end user in being well-behaved. In my book the best advise here, because it is about the user experience and not only about protection your own work.
For dashboards I get rid of tabs and scroll bars. Besides 2 exceptions, I need to come across a manager who can turn them on again without my help.
Seems that I forgot about protecting cells, sheets and workbooks altogether. Damn!
Thanks for the informative article Chandoo, I've been struggling with Excel lately. It's a powerful tool, but hard to learn for me.
Thanks Chandoo for sharing these excel sheet tips it helps me a lot to understand excel more.
Nice roundup, Chandoo! Here's one more I thought would be relevant:
For Excel 2013+, you can hide the ribbon, as shown in this animated gif: https://gridmaster.io/tips/hide-ribbon-excel-space
This will simplify the interface, making it less likely for people to accidentally make changes. 🙂
THANK YOU SIR
I'm better at Power BI thanks to you!