Search code examples
perlexcelexcel-template

Excel SUM current column (via Excel::Template)


I'm using Excel::Template to generate a series of Excel files via perl. However, I need to do a SUM function on the current Column. I know I can do

=SUM(3:15)

but that gives the sum of ALL columns in rows 3-15. Is there an easier way to do what I'm trying to do?


Solution

  • =sum(indirect(concatenate(address(<row_start>,column()),":")&address(<row_end>,column())))
    

    gives me exactly what I need. Not exactly sure how it works, but found on MrExcel.com