You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
When using the formula =COUNTIF(A1:A19;$D1), the cell's value should calculate the number of times a value occurs in a range.
What is the current behavior?
The error "Formula Error: An unexpected error occurred".
<?phprequire__DIR__ . '/vendor/autoload.php';
$test_numbers = array( 41, 57, 51, 54, 49, 43, 35, 35, 44, 47, 48, 26, 57, 34, 61, 34, 28, 29, 41 );
// Set the headers to force a download of the Excel fileheader( 'Content-Type: application/vnd.ms-excel' );
header( 'Content-Disposition: attachment; filename="test.xlsx"' );
header( 'Cache-Control: max-age=0' );
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$columnArray = array_chunk( $test_numbers, 1 );
$spreadsheet->setActiveSheetIndex( 0 )->fromArray( $columnArray, 'A1' );
$spreadsheet->setActiveSheetIndex( 0 )->setCellValue( 'C1', '=COUNTIF(A1:A19;$D1)' );
$spreadsheet->setActiveSheetIndex( 0 )->setCellValue( 'D1', 41 );
// Create a writer and send the Excel file to the browser$writer = newXlsx( $spreadsheet );
ob_end_clean();
$writer->setIncludeCharts( TRUE );
$writer->save( 'php://output' );
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Reader
Writer
Styles
Data Validations
Formula Calculations
Charts
AutoFilter
Form Elements
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Only tested with xlsx.
Which versions of PhpSpreadsheet and PHP are affected?
PHP 8.1, PhpSpreadsheet: whatever this version is: #3767
The text was updated successfully, but these errors were encountered:
This is:
What is the expected behavior?
When using the formula
=COUNTIF(A1:A19;$D1)
, the cell's value should calculate the number of times a value occurs in a range.What is the current behavior?
The error "Formula Error: An unexpected error occurred".
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Only tested with xlsx.
Which versions of PhpSpreadsheet and PHP are affected?
PHP 8.1, PhpSpreadsheet: whatever this version is: #3767
The text was updated successfully, but these errors were encountered: