The INDEX and MATCH functions have not been implemented yet, so your formula can't be evaluated.

http://svn.apache.org/repos/asf/poi/trunk/src/scratchpad/src/org/ apache/poi/hssf/record/formula/functions/Index.java http://svn.apache.org/repos/asf/poi/trunk/src/scratchpad/src/org/ apache/poi/hssf/record/formula/functions/Match.java

You can implement them yourself (and as Nick said about VLOOKUP, if you do send the implementations as a patch so that other people can use them :).

Manda

On Dec 19, 2007, at 2:28 PM, Lauren Riley wrote:

My cell value in bushelsPerFootCell is INDEX(Bushels!P13:AF67, MATCH (" + widthCell + ",Bushels!O13:O67,1), MATCH(" + lengthCell + ",Bushels!P12:AF12,1))

HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(sheet, workbook);
CellReference cellReference = new CellReference(bushelsPerFootCell);

HSSFRow evalBushelsPerFootRow = sheet.getRow(cellReference.getRow());
evaluator.setCurrentRow(evalBushelsPerFootRow);
HSSFCell evalBushelsPerFootCell = evalBushelsPerFootRow.getCell (cellReference.getCol()); HSSFFormulaEvaluator.CellValue cellValue = evaluator.evaluate (evalBushelsPerFootCell);

The cellValue has a cell type of 5 - an error. What's wrong with what I have?


Nick Burch <[EMAIL PROTECTED]>


Nick Burch <[EMAIL PROTECTED]>
12/19/2007 09:38 AM
Please respond to
"POI Users List" <[email protected]>

To

POI Users List <[email protected]>

cc


Subject

Re: Using VLOOKUP
        

On Tue, 18 Dec 2007, Lauren Riley wrote:
> If I go to the second cell's function in the textfield, and hit enter, > then the correct value displays. So I know I have the right formula, > but it's like it can't compute the second cell because it doesn't yet > have the value from the first cell lookup. Is there a way to get around
> this?

You could try using the formula evaluator to pre-compute the cell types
and values:
  http://poi.apache.org/hssf/eval.html

Otherwise, if you know the type of the data that the cell will hold, you
could try forcing the setting of that yourself

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




__________________________________________
The information contained in this message may be privileged and confidential and protected from disclosure. If you are not the intended recipient of this message, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message, and please delete it from your computer.

Reply via email to