Dynamically reference into a structured reference column header in a table

AaronDP

New Member
Joined
Mar 3, 2013
Messages
7
Hi

Hopefully someone can help here as I have drawn a complete blank!

I have a table with dates as headers. I want to sumif rows where the sum_range is dynamically referenced.

So this formula works...

=SUMIF(Rev_WK12[[#All],[ITEM]],A8,Rev_WK12[[#All],[30/03/2013]])

table name = Rev_WK12
A8 = Reference to what I am looking for.
[ITEM] = column header title

But I want to dynamically reference the column with the date in it. So I tried...

=SUMIF(Rev_WK12[[#All],[ITEM]],A8,INDIRECT("Rev_WK12[[#All],["&N8&"]]"))

N8 = contains the Date Text. The same as the Table column name.

I have also tried removing the INDIRECT...

=SUMIF(Rev_WK12[[#All],[ITEM]],A8,"Rev_WK12[[#All],["&N8&"]]")

All ideas gratefully received :)

Working with Excel 2012 on Win 7

Thanks

Aaron
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi,

You almost got it with your INDIRECT version - just needed to format your date correctly.

Perhaps try one of the following alternatives:

Without INDIRECT:
Code:
=SUMIF(
     Rev_WK12[ITEM],
     A8,
     INDEX(Rev_WK12, 0, MATCH(TEXT(N8, "dd/mm/yyyy"), Rev_WK12[#Headers], 0)))

Using INDIRECT:
Code:
=SUMIF(
     Rev_WK12[ITEM],
     A8,
     INDIRECT("Rev_WK12[" & TEXT(N8, "dd/mm/yyyy") & "]"))

Note:
 
Upvote 0
That's great. Its taken me hour to work through it and apply it! I have taken your advice and used the INDEX & MATCH approch.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top