简体   繁体   中英

How can I match or lookup a value on Excel?

I got these 2 questions in an exam, and as easy as they sound, I couldn't get them right.

So I have this table.

在此输入图像描述

And the questions are:

1- Using a function, What is the price of the first Diesel car that appears on the list?

2- Using a function, What is the brand of the second model of the list?

If anyone can help me I'd be very grateful. Thanks.

The MATCH function is useful here https://support.office.com/en-gb/article/MATCH-function-0600e189-9f3c-4e4f-98c1-943a0eb427ca

and offset https://support.office.com/en-za/article/OFFSET-function-b3958b36-c30b-4fc3-979e-9b9bbfdcf592

Try something like

=MATCH("Diesel", E:E, 0) // CTRL + SHIFT + ENTER // returns 4

Wrap it in an offset

=OFFSET(E1, MATCH("Diesel", E:E, 0), 1, 1, 1) // returns value at F4

Num. 1 is simple. =Vlookup("Diesel",E1:F22,2,False)

Num. 2 is more difficult. =Index(A1:F22,Small(If(E1:E22,"Diesel",Row(E1:E22),""),2)-Row(E1:E22)+1,2)

Note: The formula for #2 is an array and must be entered with SHIFT + CTRL + ENTER, or else it will return #NUM.

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