2012-04-13 3 views
1

"vlookup (h2, A2 : B2000, 2, False)"으로 검색하기 위해 vlookup을 사용하고 다른 시트 "= SupplierList! A2"및 "= vlookup (SupplierList! H3, A2 : B2000, 2, False) "도 좋습니다.유효하지 않은 셀 좌표 phpExcel

"= vlookup (h3, SupplierList! A2 : B2000, 2, False)"오류가 발생하는 이유는 무엇입니까?

--------------------------- 오류 메시지 ----------------- --------------

Fatal error: Uncaught exception 'Exception' with message 'PO!G2 -> Invalid cell coordinate A' in C:\Program Files\EasyPHP-5.3.6.0\www\ExcelImporter\Classes\PHPExcel\Cell.php:288 Stack trace: #0 C:\Program Files\EasyPHP-5.3.6.0\www\ExcelImporter\Classes\PHPExcel\Cell.php(204): PHPExcel_Cell->getCalculatedValue() #1 C:\Program Files\EasyPHP-5.3.6.0\www\ExcelImporter\Documentation\Examples\index.php(36): PHPExcel_Cell->getFormattedValue() #2 {main} thrown in C:\Program Files\EasyPHP-5.3.6.0\www\ExcelImporter\Classes\PHPExcel\Cell.php on line 288

--------------------------- ERROR 메시지 -------------------------------

셀은이 **=IF(ISERROR(VLOOKUP(H2349,'Supplier List'!A:B,2,FALSE)),"-",VLOOKUP(H2349,'Supplier List'!A:B,2,FALSE))**

+0

메시지에는 계산 트리의 어딘가에 "PO! G2"라는 참조가 있는데, 계산해야 할 수식이 들어 있습니다 ... 그래서 "PO! G2 "? –

답변

0

같은 식으로 인 의견이 너무 오랫동안 ...

,

function testFormula($sheet,$cell) { 
    $formulaValue = $sheet->getCell($cell)->getValue(); 
    echo '<b>'.$cell.' Value is </b>'.$formulaValue."<br />\n"; 
    $expectedValue = $sheet->getCell($cell)->getOldCalculatedValue(); 
    echo '<b>'.$cell.' Expected Value is </b>'.((!is_null($expectedValue)) ? $expectedValue : 'UNKNOWN')."<br />\n"; 


    $calculate = false; 
    try { 
     $tokens = PHPExcel_Calculation::getInstance()->parseFormula($formulaValue,$sheet->getCell($cell)); 
     echo '<b>Parser Stack :-</b><pre>'; 
     print_r($tokens); 
     echo '</pre>'; 
     $calculate = true; 
    } catch (Exception $e) { 
     echo "PARSER ERROR: ".$e->getMessage()."<br />\n"; 

     echo '<b>Parser Stack :-</b><pre>'; 
     print_r($tokens); 
     echo '</pre>'; 
    } 

    if ($calculate) { 
     try { 
      $cellValue = $sheet->getCell($cell)->getCalculatedValue(); 
      echo '<b>'.$cell.' Calculated Value is </b>'.$cellValue."<br />\n"; 

      echo '<h3>Evaluation Log:</h3><pre>'; 
      print_r(PHPExcel_Calculation::getInstance()->debugLog); 
      echo '</pre>'; 
     } catch (Exception $e) { 
      echo "CALCULATION ENGINE ERROR: ".$e->getMessage()."<br />\n"; 

      echo '<h3>Evaluation Log:</h3><pre>'; 
      print_r(PHPExcel_Calculation::getInstance()->debugLog); 
      echo '</pre>'; 
     } 
    } 
} 


$sheet = $objPHPExcel->getActiveSheet(); 
PHPExcel_Calculation::getInstance()->writeDebugLog = true; 


testFormula($sheet,'A4'); 

이는 계산 엔진이하고있는 모든 것을 상당히 자세한 로그를 제공하여 문제의 원인을 식별 할 수 있도록 :

디버깅 계산 오류, 나는 다음과 같은 사용합니다. "잘못된

$objWriter->setPreCalculateFormulas(FALSE); 
-1

파라 해결의 야망의 problema : 당신은 단순히 파일을 저장할 때 셀 값 계산을하지 않으려면

는, 당신은을 yor 작가를 인스턴스화 한 후, 그러나 저장 명령을 실행하기 전에 다음 명령을 실행할 수 있습니다 셀 좌표 "$ this-> caracteres = 배열 ​​( '', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' , 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U' 'A', 'AF', 'AG', 'V', 'X', 'Y', 'W', 'Z', ' AH, AI, AJ, AK, AL, AM, 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT' ','AU ','AV ','AX ' , 'AY', 'AW', 'AZ');

adicione mais caracteres, 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ' AK ','AL ','AM ', 'AN ','AO ','AP ','AQ ','AR ','AS ','AT ' ','AY ','AW ','AZ '); ...

영어 "셀 좌표가 잘못되었습니다."$ this-> characters = array ( '', 'A', 'B', 'C', 'D', 'E' , 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P' 'R', 'S', 'T', 'U', 'V', 'X', 'Y', 'W', 'Z' 'AA', 'AB' ','AF ','AG ','AH ','AI ','AJ ','AK ','AL ','AM ' 'AN ','AO ','AP ' AR, AS, AT, AU, AV, AX, AY, AW, AZ); AC, AG, AH, AI, AJ, AJ, 'AJ', 'AJ', 'AJ' AN, AO, AP, AQ, AR, AS, AT, AU, AV, AX, AK, AL, , 'AY', 'AW', 'AZ'); ....