Look up Cell data based on Month header in table

我的梦境 提交于 2019-12-12 05:48:01

问题


i'm trying to create a small spreadsheet for data verification. Below i have created two tables Table 1 and Table 2.

What i am trying to find is a simple =Index Match or similar to check for Current month then copy that value to respective Group row under verification.

Problem is that the months are a header row and i have no idea how to check a header row for correct month then output the values in the cells below it to each corresponding group in the output list.

So to put it in programming terms this is what im looking for

If A2=Table2[Header] then c8=C4 else table[header] + step right

A2 contains todays Date (=today()) and Header has the shorten Month names as Jan Feb Mar and so on. Something similar as above, i don't know if i'm making it harder for me then it really should be. I'm working with Excel 2013.

Output list
Group    Input  Verification  Differance
G1       120    123           =Sum([@[Input]]-[@[Verification])
G2        76    110           =Sum([@[Input]]-[@[Verification])
G3       110    90            =Sum([@[Input]]-[@[Verification])
G4        34    53            =Sum([@[Input]]-[@[Verification])

Data list
Group    Year   Jan Feb Mar Apr 
G1       2017       123 95  80                              
G2       2017       110 85  75                              
G3       2017       90  80  70                              
G4       2017       53  53  46      

Regards Johan


回答1:


You would use a second match to find the correct column:

=INDEX(DataList,MATCH([@Group],DataList[Group],0),MATCH(TEXT($A$1,"mmm"),DataList[#Headers],0))



来源:https://stackoverflow.com/questions/42393801/look-up-cell-data-based-on-month-header-in-table

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