That formula is never going to work in PHPExcel without a complete rewrite of the calculation engine.

All PHPExcel functions return values (or arrays of values), so OFFSET(A2,0,3) will return the contents of cell A5, which is normally the behaviour that is required when OFFSET() is used.

SUM(C2:OFFSET(A2,0,3)) requires the OFFSET() function to return the cell reference for A5, not the value contained there, effectively giving you the formula SUM(C2:A5), so it all comes down to a question of context.

Used in most contexts, OFFSET() should return values; but in a few contexts, it should return a reference instead. The parser in PHPExcel is a basic LR (Left to Right) parser rather than a more sophisticated LALR (Look-Ahead Left to Right) parser: the latter
would be able to identify the context, and whether any given function should return a value of a reference; but this would require a lot more code to implement within the parser itself, and would come with a performance overhead (not to mention a complete
rewrite of the function library as well).

Syntax for OFFSET is rows then columns rather than columns then rows, so OFFSET(A2,0,3))=D2

But the fact still remains that (without significant rewrite of the calculation engine) PHPExcel returns the value of the cell, not the address/reference of the cell; but SUM(C2:OFFSET(A2,0,3)) requires the reference to give C2:D2

I have no idea why, I wasn't even sure whether it would retun anything or simply go into a permanent loop, although you haven't imlemented it as I expected.

=SUM(INDIRECT("D6:"&ADDRESS(ROW(D6),COLUMN(D6)+5,4,1)));

Without setting up a test spreadsheet and stepping through the code a line at a time, I'm unlikely to be able to provide you with an answer.

While the PHPExcel calculation engine and function library attempts to replicate Excel's behaviour in most regards, we make no guarantess that it will work identically to Excel in every regard; and definitely not when using the more esoteric functions such
as OFFSET and INDIRECT. I'll have a look and see what I can do, but to provide any solution I'm going to have to convert the calculation engine to a Look-Ahead parser, which is a complicated task, will take some time, and will adversely affect performance
and memory usage.