Chain Combobox

Topics: Developer Forum, Project Management Forum, User Forum
Sep 2, 2010 at 8:31 AM

Hi, Iam From Indonesia. I like PHPexcel function. Can Excel5/Excel 2003 put logical function to setFormula data validation??

my english it's not verry well,  this my code

$objValidation = $objPHPExcel->getActiveSheet()->getCell('I13')->getDataValidation();
$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_LIST );
$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_INFORMATION );
$objValidation->setAllowBlank(true);
$objValidation->setShowInputMessage(true);
$objValidation->setShowErrorMessage(true);
$objValidation->setShowDropDown(true);
$objValidation->setErrorTitle('Input error');
$objValidation->setError('Value is not in list.');
$objValidation->setPromptTitle('Pick from list');
$objValidation->setPrompt('Please pick a value from the drop-down list.');
$objValidation->setFormula1('"=IF(B13=5,M45:M50,INDEX(K:K,MATCH(I15,L:L,0)))"');   
$objPHPExcel->getActiveSheet()->getCell('I13')->setDataValidation($objValidation);

can I use the "=IF(B13=5,M45:M50,INDEX(K:K,MATCH(I15,L:L,0)))" to setFormula ???

Coordinator
Sep 3, 2010 at 11:08 AM
Edited Sep 3, 2010 at 11:10 AM

In theory, yes, you can use a formula like this unless it uses functions that aren't yet supported by the PHPExcel calculation engine; but there are a couple of problems with the use of the INDEX() and MATCH() functions in formulae at the moment. See Work Item 13821 for details.