| Edit: Changed subject, was FORMULA CREATION Make your post understandable by others -- MrProgrammer, forum moderator |
[Dropped] Return three integers from two arguments
[Dropped] Return three integers from two arguments
Is it possible for a user to create a formula that takes two argumemts and returns three integers?
Last edited by MrProgrammer on Sun Aug 18, 2024 3:36 pm, edited 2 times in total.
Reason: Dropped: No attachment provided when requested and no response to questions -- MrProgrammer, forum moderator
Reason: Dropped: No attachment provided when requested and no response to questions -- MrProgrammer, forum moderator
Open Office 4.1.15, Windows 11
Re: Return three integers from two arguments
Are you thinking of a formula in a cell, or a custom function (coded in some macro language) to use in a cell formula?
Either way, the basic spreadsheet formula is entered in a cell, and the result from calculating that formula will be the value of that cell.
A cell value is "atomic"; you can have either a numerical value or a text (character string). Returning multiple numeric values requires that you utilize multiple cells.
For one formula to return values to multiple cells (sometimes referred to as "spill"), I believe that array mode needs to be employed on some level. Some of Calc's functions/operations have implicit array context, others can be forced into array context, and some do not support arrays.
This may answer your question, or not. If you need more detail, you could explain specifically what you are trying to achieve. It would help us to help you.
Either way, the basic spreadsheet formula is entered in a cell, and the result from calculating that formula will be the value of that cell.
A cell value is "atomic"; you can have either a numerical value or a text (character string). Returning multiple numeric values requires that you utilize multiple cells.
For one formula to return values to multiple cells (sometimes referred to as "spill"), I believe that array mode needs to be employed on some level. Some of Calc's functions/operations have implicit array context, others can be forced into array context, and some do not support arrays.
This may answer your question, or not. If you need more detail, you could explain specifically what you are trying to achieve. It would help us to help you.
Re: Return three integers from two arguments
The exact numbers of arguments and of numbers to output isn't of much interest.
The relevant fact is in what way the numbers for output can be calculated.
If this must be done by different (basically independent) expressions there is -imo- no way based on standard functions of Calc.
It can be done with the help of user code, but it won't be practicable to write an extra function for every number of arguments. To get a more flexible solution the ParamArray concept available under "Option VBAsupport 1" would be very useful.
In special cases the task can be done by standard formulas. This is possible if the multiple results can be calculated as elements of a sequence described by a non-recursive generator. Even 2D-arrays are somtimes to get this way.
You find some examples in the attached document. For open questions please be more precise about your actual problem and attach an example file (what I have / what I want) yourself.
The relevant fact is in what way the numbers for output can be calculated.
If this must be done by different (basically independent) expressions there is -imo- no way based on standard functions of Calc.
It can be done with the help of user code, but it won't be practicable to write an extra function for every number of arguments. To get a more flexible solution the ParamArray concept available under "Option VBAsupport 1" would be very useful.
In special cases the task can be done by standard formulas. This is possible if the multiple results can be calculated as elements of a sequence described by a non-recursive generator. Even 2D-arrays are somtimes to get this way.
You find some examples in the attached document. For open questions please be more precise about your actual problem and attach an example file (what I have / what I want) yourself.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München