in reply to Excel chart for dynamic data

You can use the function
xl_range_formula($sheetname, $row_1, $row_2, $col_1, $col_2)
as explained here Working_with_Cell_Ranges
poj