Hi
I have a workbook (salesdata.xls) which contains sales information for a full year by department, it looks like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Week[/TD]
[TD]Dept A[/TD]
[TD]Dept B[/TD]
[TD]Dept C[/TD]
[TD]Dept D[/TD]
[TD]Dept E[/TD]
[TD]Dept F[/TD]
[TD]Dept G[/TD]
[/TR]
[TR]
[TD]Week 1[/TD]
[TD]700[/TD]
[TD]520[/TD]
[TD]100[/TD]
[TD]620[/TD]
[TD]44[/TD]
[TD]120[/TD]
[TD]800[/TD]
[/TR]
[TR]
[TD]Week 2[/TD]
[TD]125[/TD]
[TD]522[/TD]
[TD]144[/TD]
[TD]800[/TD]
[TD]55[/TD]
[TD]170[/TD]
[TD]700[/TD]
[/TR]
[TR]
[TD]Week 3[/TD]
[TD]122[/TD]
[TD]400[/TD]
[TD]200[/TD]
[TD]120[/TD]
[TD]44[/TD]
[TD]150[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]Week 4[/TD]
[TD]100[/TD]
[TD]350[/TD]
[TD]180[/TD]
[TD]100[/TD]
[TD]70[/TD]
[TD]190[/TD]
[TD]600[/TD]
[/TR]
[TR]
[TD]Week 5[/TD]
[TD]230[/TD]
[TD]400[/TD]
[TD]158[/TD]
[TD]164[/TD]
[TD]80[/TD]
[TD]170[/TD]
[TD]500[/TD]
[/TR]
</tbody>[/TABLE]
On a separate workbook (depts.xls) I want to pull information by department for a specific week, like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Dept A[/TD]
[TD] [/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Week Number:[/TD]
[TD]4[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need the sheet to be able to pull the sales for that department for the week specified.
I know how to use VLOOKUP to pull this information using a formula for a specific row or cell, but I don't know how to pull the information based on the value of the week (which would be in cell B3 in the example above). Therefore when I change the week number (in B3 above) to 5 the sales in cell C3 would show 230.
Hope this is clear. Thanks in advance for any help.
I have a workbook (salesdata.xls) which contains sales information for a full year by department, it looks like this:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Week[/TD]
[TD]Dept A[/TD]
[TD]Dept B[/TD]
[TD]Dept C[/TD]
[TD]Dept D[/TD]
[TD]Dept E[/TD]
[TD]Dept F[/TD]
[TD]Dept G[/TD]
[/TR]
[TR]
[TD]Week 1[/TD]
[TD]700[/TD]
[TD]520[/TD]
[TD]100[/TD]
[TD]620[/TD]
[TD]44[/TD]
[TD]120[/TD]
[TD]800[/TD]
[/TR]
[TR]
[TD]Week 2[/TD]
[TD]125[/TD]
[TD]522[/TD]
[TD]144[/TD]
[TD]800[/TD]
[TD]55[/TD]
[TD]170[/TD]
[TD]700[/TD]
[/TR]
[TR]
[TD]Week 3[/TD]
[TD]122[/TD]
[TD]400[/TD]
[TD]200[/TD]
[TD]120[/TD]
[TD]44[/TD]
[TD]150[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]Week 4[/TD]
[TD]100[/TD]
[TD]350[/TD]
[TD]180[/TD]
[TD]100[/TD]
[TD]70[/TD]
[TD]190[/TD]
[TD]600[/TD]
[/TR]
[TR]
[TD]Week 5[/TD]
[TD]230[/TD]
[TD]400[/TD]
[TD]158[/TD]
[TD]164[/TD]
[TD]80[/TD]
[TD]170[/TD]
[TD]500[/TD]
[/TR]
</tbody>[/TABLE]
On a separate workbook (depts.xls) I want to pull information by department for a specific week, like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Dept A[/TD]
[TD] [/TD]
[TD]Sales[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Week Number:[/TD]
[TD]4[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need the sheet to be able to pull the sales for that department for the week specified.
I know how to use VLOOKUP to pull this information using a formula for a specific row or cell, but I don't know how to pull the information based on the value of the week (which would be in cell B3 in the example above). Therefore when I change the week number (in B3 above) to 5 the sales in cell C3 would show 230.
Hope this is clear. Thanks in advance for any help.