getSpreadsheet(); $sheet = $this->getSheet(); $sheet->setTitle('Feuil1'); $tableSheet = $spreadsheet->createSheet(); $tableSheet->setTitle('sheet_with_table'); $tableSheet->fromArray( [ ['MyCol', 'Colonne2', 'Colonne3'], [10, 20], [2], [3], [4], ], null, 'B1', true ); $table = new Table('B1:D5', 'Tableau1'); $tableSheet->addTable($table); $sheet->setSelectedCells('F7'); $tableSheet->setSelectedCells('F8'); self::assertSame($sheet, $spreadsheet->getActiveSheet()); $sheet->getCell('A1')->setValue('=SUM(Tableau1[MyCol])'); $sheet->getCell('A2')->setValue('=SUM(Tableau1[])'); $sheet->getCell('A3')->setValue('=SUM(Tableau1)'); $sheet->getCell('A4')->setValue('=CONCAT(Tableau1)'); self::assertSame(19, $sheet->getCell('A1')->getCalculatedValue()); self::assertSame(39, $sheet->getCell('A2')->getCalculatedValue()); self::assertSame(39, $sheet->getCell('A3')->getCalculatedValue()); self::assertSame('1020234', $sheet->getCell('A4')->getCalculatedValue(), 'Header row not included'); self::assertSame('F7', $sheet->getSelectedCells()); self::assertSame('F8', $tableSheet->getSelectedCells()); self::assertSame($sheet, $spreadsheet->getActiveSheet()); } }