简体   繁体   中英

Excel, VLOOKUP or INDEX MATCH with multiple criteria

I have a spreadsheet that has data formatted as follows:

在此处输入图片说明

I want to create a vlookup or an index match where I can type the Date, and category(MIB, DAX, CAC, etc.) in 2 different cells and it will pull the correct open value. ie. In adjacent cells I type 2016-03-08, then CAC, it should return 4405.1602.

I have had trouble creating this because of the way the data is formatted (I cant format any other way, it is coming in live from a third party source), as well because the dates do not always line up.

I have tried creating a seperate VLOOKUP for each category, B3:C13 for MIB, D3:E13 for DAX, but this is extremely time consuming as the actual spreadsheet goes much further and contains much more data than the sample I have given here, so I am hoping there is a formula I can use to avoid this.

$FTSEMIB-MIL            $DAX-XET            $PX1-EEB            $UKX-FTSE       
Date    Open    Last    Date    Open    Last    Date    Open    Last    Date    Open    Last
2016-03-18  18704.369   18611.34    2016-03-18  9905.6699   9950.8  2016-03-18  4452.04 4462.51 2016-03-18  6201.1201   6189.64
2016-03-17  18921.43    18608.029   2016-03-17  10051.69    9892.2002   2016-03-17  4501.6802   4442.8901   2016-03-17  6175.4902   6201.1201
2016-03-16  18820.789   18731.75    2016-03-16  9971.04 9983.4102   2016-03-16  4486.7002   4463    2016-03-16  6139.9702   6175.4902
2016-03-15  18891.721   18765.369   2016-03-15  9941.46 9933.8496   2016-03-15  4474.2598   4472.6299   2016-03-15  6174.5698   6139.9702
2016-03-14  19125.109   18981.77    2016-03-14  9948.21 9990.2598   2016-03-14  4501.8101   4506.5898   2016-03-14  6139.79 6174.5698
2016-03-11  18488.82    18987.75    2016-03-11  9672.0498   9831.1299   2016-03-11  4430.2402   4492.79 2016-03-11  6036.7002   6139.79
2016-03-10  18229.24    18118.23    2016-03-10  9697.6396   9498.1504   2016-03-10  4432.5601   4350.3501   2016-03-10  6146.3198   6036.7002
2016-03-09  17982.369   18208.92    2016-03-09  9700.1602   9723.0898   2016-03-09  4405.9502   4425.6499   2016-03-09  6125.4399   6146.3198
2016-03-08  17906.02    18017.561   2016-03-08  9688.4697   9692.8203   2016-03-08  4405.1602   4404.02 2016-03-08  6182.3999   6125.4399
2016-03-07  18195.6 18059.27    2016-03-07  9764.0801   9778.9297   2016-03-07  4436.3701   4442.29 2016-03-07  6199.4302   6182.3999
2016-03-04  18415.359   18278.98    2016-03-04  9800.8604   9824.1699   2016-03-04  4437.8198   4456.6201   2016-03-04  6130.46 6199.4302
2016-03-03  18217.98    18348.5 2016-03-03  9807.0596   9751.9199   2016-03-03  4430.8999   4416.0801   2016-03-03  6147.0601   6130.46
2016-03-02  18143.221   18206.41    2016-03-02  9780.8398   9776.6201   2016-03-02  4428.9502   4424.8901   2016-03-02  6152.8799   6147.0601
2016-03-01  17557.23    18011.91    2016-03-01  9482.6602   9717.1602   2016-03-01  4343.9302   4406.8398   2016-03-01  6097.0898   6152.8799
2016-02-29  17341.74    17623.07    2016-02-29  9424.9297   9495.4004   2016-02-29  4275.8398   4353.5498   2016-02-29  6096.0098   6097.0898
2016-02-26  17299.029   17483.76    2016-02-26  9454.5195   9513.2998   2016-02-26  4297.8701   4314.5698   2016-02-26  6012.8101   6096.0098
2016-02-25  16939.52    17104.539   2016-02-25  9277.0195   9331.4805   2016-02-25  4219.7998   4248.4502   2016-02-25  5867.1802   6012.8101
2016-02-24  17157.73    16719.359   2016-02-24  9396.4805   9167.7998   2016-02-24  4232.48 4155.3398   2016-02-24  5962.3101   5867.1802
2016-02-23  17340.23    17163.461   2016-02-23  9503.1201   9416.7695   2016-02-23  4272.2202   4238.4199   2016-02-23  6037.73 5962.3101
2016-02-22  17127.65    17504.58    2016-02-22  9481.3701   9573.5898   2016-02-22  4260.6201   4298.7002   2016-02-22  5950.23 6037.73
2016-02-19  17024.76    16909.561   2016-02-19  9420.5098   9388.0498   2016-02-19  4232.2202   4223.04 2016-02-19  5971.9502   5950.23

Use a conventional VLOOKUP function with the date as the lookup_value . Select and shape the table_array parameter from a larger block of data using an INDEX / MATCH function pair matching the category across row 4.

In E15 as a standard formula,

=VLOOKUP(D15, INDEX($B$6:$H$13, 0, MATCH(C15, B$4:H$4, 0)):INDEX($C$6:$I$13, 0, MATCH(C15, B$4:H$4, 0)), 2, FALSE)

Fill down as necessary.

vlookup_index_match

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