• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Dynamic Offset reference

Manojkumar S

New Member
I had created dynamic chart based on Offset, chart will display the data from table. Currently reference for offset is static and i would like to keep it dynamic so that when the starting reference is changed i don't need to keep on changing every time.

Table Name is "Trend_Data"
Sheet Name where table is created is "Data"

Below code will find the starting location of table located. Trend_Start_Col is the Name Manager created for the below formula and used in offset formula.

Code:
=SUBSTITUTE(ADDRESS(1,COLUMN(Trend_Data[#Headers])+1,1),"$1","")&"$"&ROW(Trend_Data[#Headers])

Offset formula used for creating dynamic chart.

Code:
=OFFSET("Data!" & (Trend_Start_Col), 0, 24, 1, 40)

Note: Numbers mentioned in offset formula are achieved dynamically. For easy readability i hadn't provided the complete formula.

Now i need to link the Sheet name "Data" with the Name manager while updating in the chart. Above formula throws error and i could not able to achieve.

Is there any way of creating dynamic offset reference?
 
Yes but i had no issues in creating the dynamic chart. First parameter [reference] to Offset is hard-coded and i need to make it dynamic based on the formula.
 
Hi ,

See if using the INDIRECT function helps , as in :

=OFFSET(INDIRECT("Data!" & Trend_Start_Col), 0, 24, 1, 40)

For this to work , the named range Trend_Start_Col has to evaluate to a string.

If this does not work , please upload your workbook.

Narayan
 
No it doesn't work. I had tried already, when INDIRECT was used sheet was not referred only value from Trend_Start_Col is calculated.

Attached my report file and you can refer B14 column for the formula.
 

Attachments

  • Report.xlsx
    14.7 KB · Views: 10
Back
Top