× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Happy Friday all;

Problem I'm working on is to create a formula that looks like this:

=IF(AG37=0,"00%",AG28-K28-M28-E28-G28)/AG37

The above formula works fine, except if AG37 is 0, Then I get a #div
error.

This is the code I'm using to get the above formula

formulastr = 'IF('+drtot_c + '=0,"00%", '+
%trim(sbtot_c) + '-' +
%trim(gaprt_k) + '-' +
%trim(gaprt_m) + '-' +
%trim(cpirt_e) + '-' +
%trim(cpirt_g) + ')' + '/' +
%trim(drtot_c);

hssf_formula( row:32: %trim(formulastr):Percent);

If I go into excel and change the formula as follows, I get rid of the
#div error.

=IF(AG37=0,"00%",(AG28-K28-M28-E28-G28)/AG37

But if I change the rpg code, I get a Java exception
"java.lang.RuntimeException: Cannot Parse, sorry : Integer
Expected" when calling method "setC" with signature "" in class
"org.apache.poi.hssf.usermodel.HSSFCell".

formulastr = 'IF('+drtot_c + '=0,"00%", '+
'(' +%trim(sbtot_c) + '-' +
%trim(gaprt_k) + '-' +
%trim(gaprt_m) + '-' +
%trim(cpirt_e) + '-' +
%trim(cpirt_g) + ')' + '/' +
%trim(drtot_c);

Thanks in advance.


Darrell Lee
Information Technology
Extension 7127

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.