Look up Cell data based on Month header in table

2019-09-12 08:43发布

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条回答
2楼-- · 2019-09-12 09:37

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))

enter image description here

查看更多
登录 后发表回答