# poi-user mailing list archives

##### Site index · List index
Message view
Top
From "Mili Aggarwal, Noida" <mi...@noida.hcltech.com>
Subject RE: COUNTIF Formula results in #VALUE
Date Tue, 28 Dec 2004 03:24:43 GMT
```>From my experience,you get #value when u r referencing the wrong cell for
computation,which cannot be used for calculation.For ex,if you r trying to
add an integer to a string.So try to see if that is the problem.

Warm Regards,
Mili Aggarwal

-----Original Message-----
From: Lior Shliechkorn [mailto:liorshliech@yahoo.com]
Sent: Tuesday, December 28, 2004 2:56 AM
To: poi-user@jakarta.apache.org
Subject: COUNTIF Formula results in #VALUE

Hello,

I've created an excel file, which I need to create a column of rows where I
want to use the COUNTIF function. My method currently is creating a temp
file of the report I generated, and then re-read the file in to modify cells
to contain the formula.

I managed a row index called GLOBAL_ROW_COUNT and I basically have the
following code block:

private void modifySheet( HSSFSheet sheet ) {
HSSFRow row = null;
HSSFCell cell = null;
for( short i = 2; i < (GLOBAL_ROW_COUNT - 1); i++ ) {
row = sheet.getRow( i );
cell = row.getCell( (short) 19 );
cell.setCellFormula( "COUNTIF(S3:S" +
(GLOBAL_ROW_COUNT - 1) +",S" + ( i + 1 ) + ")" );
}
}

So this scans the whole column for instances of the current cell within that
column. Now, I'm getting a #VALUE result. But when I hit F2 to modify the
cell and then simply just hit enter I see the correct value. What can I do
to solve this issue?

Thank you very much,

Lior Shliechkorn

__________________________________
Do you Yahoo!?
http://info.mail.yahoo.com/mail_250

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org