Extract a value from the chart, filtered by criteria in excel

ぐ巨炮叔叔 提交于 2019-12-11 17:17:29

问题


I've got two sheets like this in excel :

Price chart :

                            **Post AB**    **Post  Tenn**   **Post DN**
                         Price 10.1-10.20  Price 10.1-10.20  Price 10.1-20.1
CityOrigin  Destination      20 kg  40 kg    20 kg  40 kg     20 kg  40 kg

New York     Madrid          45      40     40      50       45      40
Los Angeles  Madrid          65      70     70      70       56      60
Oregon       Paris           89      100    110     105      74      98
Washington   Paris           34      80     45      65       45      69

and Working chart:

                                            Price Rate
Post Career  CityOrigin          Date            20KG      40KG
Post AB      New Tork          =Today()            ?        ?
Post Tenn    Los Angles            "               ?        ?
Post DN      Oregon                "               ?        ?

I am wondering, is it possible to use today date with Post Career and City origin to extract only rates that are actually valid for today for 20kg and 40kg packages from price chart sheet?

My ideal result should be look like this :

                                                   Price Rate
Post Career  CityOrigin          Date            20KG      40KG
Post AB      New York             10/20           40       45
Post Tenn    Los Angles           10/20           70       70
Post DN      Oregon               10/20           74       98

My question is which function I should use to call the price based on date and post career from price sheet? multiple Lookup??


回答1:


So here is what I have so far without knowing how other date ranges will be like in your data structure, but this should give you something to work on.

The formula I entered in cell D13 is:

=INDEX($C$4:$H$7,MATCH($B13,$A$4:$A$7,0),MATCH($A13,$C$1:$H$1,0)+IF(D$12="20 kg",0,1))

Basically I just use INDEX/MATCH to lookup the row and column numbers. Once you have other data come in to play, I can take another look if you can't find a way around it.

Please note that I have removed the * sign on row 1 so it is easier to do in the MATCH function, otherwise, you will need to use array formula to do this and that is probably not the way you want to go.



来源:https://stackoverflow.com/questions/46847655/extract-a-value-from-the-chart-filtered-by-criteria-in-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!