简体   繁体   中英

Error using Vlookup function in Excel

I have the following data set:

在此输入图像描述

I calculate the maximum return using =max(B2:B13) in cell D3 (ie, 13.55%), and then I would like to find the date where this maximum return was realized. Thus, I use =vlookup(D3;A2:B13;1;FALSE) , and I get as a result #N/A , which is clearly wrong. How can I make this work?

You can't use a VLOOKUP to find a value that isn't in the first column of your data table. Use an INDEX/MATCH formula instead:

=INDEX(A2:A13,MATCH(MAX(B2:B13),B2:B13,0))

A VLOOKUP is a V ertical Lookup - and is used to look up a value in the first column of a table and return a corresponding value from another column in that table (just like looking at a timetable for example).

You are trying to find the max value from column B, in column A - where it doesn't exist so you're not going to find it. In order to use a VLOOKUP the lookup_value must be in the first column of the data table.

If you want to look up a value in another column of the data table, then you need to use =INDEX(MATCH()) instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM