OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

A function problem

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
nejko
Newbie
Newbie


Joined: 25 Jan 2005
Posts: 3

PostPosted: Tue Jan 25, 2005 1:59 pm    Post subject: A function problem Reply with quote

Hi,

I have an Excel workbook with such a function:

Code:
=DSUM(BRUTOBIL!$A$1:$K$1800;"SALDE";INDIRECT(CONCATENATE("BSDefs!";B33;"1")):INDIRECT(CONCATENATE("BSDefs!";B33;"30")))/1000


Of course in Excel it works fine. Now I'd like to translate it to work in OOo Calc:
When I opened the .xls file in Calc, the function I got was this one:

Code:
=DSUM($BRUTOBIL.$A$1:$K$1800;"SALDE";#NAME!(INDIRECT(CONCATENATE("BSDefs!";B33;"1"));INDIRECT(CONCATENATE("BSDefs!";B33;"30"))))/1000


So looks like Calc messes something up (a "$" in front of "BRUTOBIL" worksheet name and "#NAME!" there in the middle). OK, I cleaned it up and replaced "!" with "." since Calc uses dot to reference to other worksheets AFAIK:

Code:
=DSUM(BRUTOBIL.$A$1:$K$1800;"SALDE";INDIRECT(CONCATENATE("BSDefs.";B33;"1")):INDIRECT(CONCATENATE("BSDefs.";B33;"30")))/1000


Still, this formula doesn't work. Looks like condition can't be composed of two "INDIRECT" calls like in Excel. Any ideas how to deal with it? If I replace the condition with:

Code:
BSDefs.F1:BSDefs.F30


everything works fine and the result is correct.

Thank you very much for any help. If I solve this I don't have to buy MS Office.
Back to top
View user's profile Send private message
richhill
OOo Advocate
OOo Advocate


Joined: 16 Jun 2004
Posts: 418
Location: Mesa, AZ

PostPosted: Tue Jan 25, 2005 8:40 pm    Post subject: Reply with quote

Is this what you want the INDIRECT and CONCATENATE functions to generate??

=DSUM(BRUTOBIL.$A$1:$K$1800;"SALDE";BSDefs.F1:BSDefs.F30)
_________________
OOo Calc tips: http://www.openofficetips.com
Back to top
View user's profile Send private message Visit poster's website
nejko
Newbie
Newbie


Joined: 25 Jan 2005
Posts: 3

PostPosted: Wed Jan 26, 2005 8:26 am    Post subject: Reply with quote

richhill wrote:
Is this what you want the INDIRECT and CONCATENATE functions to generate??

=DSUM(BRUTOBIL.$A$1:$K$1800;"SALDE";BSDefs.F1:BSDefs.F30)


Actually, yes. If i remove INDIRECT function calls (leave only CONCATENATE), I get error 508 again. Hints?

Thanks.
Back to top
View user's profile Send private message
richhill
OOo Advocate
OOo Advocate


Joined: 16 Jun 2004
Posts: 418
Location: Mesa, AZ

PostPosted: Wed Jan 26, 2005 9:16 am    Post subject: Reply with quote

Error 508 is missing bracket(s) - check the revised formula - that number of "(" matches number of ")".
_________________
OOo Calc tips: http://www.openofficetips.com
Back to top
View user's profile Send private message Visit poster's website
nejko
Newbie
Newbie


Joined: 25 Jan 2005
Posts: 3

PostPosted: Thu Jan 27, 2005 5:11 am    Post subject: Reply with quote

richhill wrote:
Error 508 is missing bracket(s) - check the revised formula - that number of "(" matches number of ")".


I pasted you revised formula and as you can see all the brackets are in place. I lost a few hours on that and I triple checked every bracket but no luck.

Any other ideas? I just assume that D-functions (DSUM is one of them) just don't support such types of arguments for conditions as in Excel - it must be Workbook.FIELD:Workbook.FIELD style and it can't be composed of functions. Is this correct? Any ideas how to make an alternative which would achieve the same as in Excel?

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group