aVadim483 / fast-excel-reader

Lightwight and very fast XLSX Excel Spreadsheet Reader in PHP
MIT License
63 stars 16 forks source link

Merged cells #28

Open Jan-Walther-Blackbit opened 3 weeks ago

Jan-Walther-Blackbit commented 3 weeks ago

Is there a way to support merged cells? In this case all columns within the merge range should return the same value. Currently only the first column in the merge range has the value, the other ones have "".

aVadim483 commented 2 weeks ago

When you merge cells, Excel actually writes the value to only the first one. That's why you get this result

Jan-Walther-Blackbit commented 2 weeks ago

Ok, but is it possible to detect if a cell is merged with another one?

aVadim483 commented 2 weeks ago

And you can use:

aVadim483 commented 2 weeks ago

For example

if ($sheet->isMerged('B3')) {
    $range = $sheet->mergedRange('B3');
}