开发者

VLookup if Lookup Value Located in Column to the Right of Table Array

I have a spreadsheet 开发者_如何学Goset up, and it already contains a lot of data. The A column holds date objects and column B holds numerical values. I want to use Vlookup to find the numerical value and to return the corresponding date value. The problem is that Vlookup searches in the leftmost column of the table array, which is a problem since the column holds dates. This would be easy to do if I was looking up dates, but how can I do it for looking up the numerical value. I understand that swapping the date and numerical column would do it, but I'm looking for a solution that allows me to keep the structure of my spreadsheet intact.


Example

date         value
01/01/2010    4
10/02/2011    5
15/03/2011    2


=INDICE(A2:A4;CONFRONTA(5;B2:B4;0))

This gives you 10/02/2011.

These are Italian function names. English equivalents are INDEX and MATCH, respectively.

edit. Update after user's question.

Let' suppose that your dates are in the range a2:a7 and its values on b2:b7 and that you're looking for the most recent date that has a value of 5:

=MAX(IF($B$2:$B$7=5;$A$2:$A$7))

you have to use array formula, so you need to press ctrl+shift+enter once you've typed the it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜