How to create an array of values in LibreOffice Calc?











up vote
3
down vote

favorite












I'm using LibreOffice 5.1.4.2 Calc and need to calculate the internal rate of return for a certain payment (say, in cell A1), a certain number of times (say, 100).



If I had the value repeated 100 times (say, in A1:A100), I could do:



=IRR(A1:A100)


But it seems odd (what if it's 100,000 times?).



The problem is, the function IIR expects “an array containing the values”.



How can I pass along to IRR an array of the value in A1 repeated 100 times?










share|improve this question






















  • I believe I've been confused what you were after here, sorry about that. In your example above do the cells A1:A100 all contain a single fixed payment? That is, the spreadsheet equivalent of { 7 | 7 | 7 | 7 ... 95x ... 7 }. Is your question "What if I needed { 7 | 7 | 7 | 7 ... 100,995x ... 7 } instead"? Now that I read more carefully, that appears to be how Jim DeLaHunt has interpreted the question.
    – kwutchak
    Nov 23 at 19:48

















up vote
3
down vote

favorite












I'm using LibreOffice 5.1.4.2 Calc and need to calculate the internal rate of return for a certain payment (say, in cell A1), a certain number of times (say, 100).



If I had the value repeated 100 times (say, in A1:A100), I could do:



=IRR(A1:A100)


But it seems odd (what if it's 100,000 times?).



The problem is, the function IIR expects “an array containing the values”.



How can I pass along to IRR an array of the value in A1 repeated 100 times?










share|improve this question






















  • I believe I've been confused what you were after here, sorry about that. In your example above do the cells A1:A100 all contain a single fixed payment? That is, the spreadsheet equivalent of { 7 | 7 | 7 | 7 ... 95x ... 7 }. Is your question "What if I needed { 7 | 7 | 7 | 7 ... 100,995x ... 7 } instead"? Now that I read more carefully, that appears to be how Jim DeLaHunt has interpreted the question.
    – kwutchak
    Nov 23 at 19:48















up vote
3
down vote

favorite









up vote
3
down vote

favorite











I'm using LibreOffice 5.1.4.2 Calc and need to calculate the internal rate of return for a certain payment (say, in cell A1), a certain number of times (say, 100).



If I had the value repeated 100 times (say, in A1:A100), I could do:



=IRR(A1:A100)


But it seems odd (what if it's 100,000 times?).



The problem is, the function IIR expects “an array containing the values”.



How can I pass along to IRR an array of the value in A1 repeated 100 times?










share|improve this question













I'm using LibreOffice 5.1.4.2 Calc and need to calculate the internal rate of return for a certain payment (say, in cell A1), a certain number of times (say, 100).



If I had the value repeated 100 times (say, in A1:A100), I could do:



=IRR(A1:A100)


But it seems odd (what if it's 100,000 times?).



The problem is, the function IIR expects “an array containing the values”.



How can I pass along to IRR an array of the value in A1 repeated 100 times?







worksheet-function openoffice libreoffice spreadsheet openoffice-calc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 23 '16 at 16:51









tripu

566




566












  • I believe I've been confused what you were after here, sorry about that. In your example above do the cells A1:A100 all contain a single fixed payment? That is, the spreadsheet equivalent of { 7 | 7 | 7 | 7 ... 95x ... 7 }. Is your question "What if I needed { 7 | 7 | 7 | 7 ... 100,995x ... 7 } instead"? Now that I read more carefully, that appears to be how Jim DeLaHunt has interpreted the question.
    – kwutchak
    Nov 23 at 19:48




















  • I believe I've been confused what you were after here, sorry about that. In your example above do the cells A1:A100 all contain a single fixed payment? That is, the spreadsheet equivalent of { 7 | 7 | 7 | 7 ... 95x ... 7 }. Is your question "What if I needed { 7 | 7 | 7 | 7 ... 100,995x ... 7 } instead"? Now that I read more carefully, that appears to be how Jim DeLaHunt has interpreted the question.
    – kwutchak
    Nov 23 at 19:48


















I believe I've been confused what you were after here, sorry about that. In your example above do the cells A1:A100 all contain a single fixed payment? That is, the spreadsheet equivalent of { 7 | 7 | 7 | 7 ... 95x ... 7 }. Is your question "What if I needed { 7 | 7 | 7 | 7 ... 100,995x ... 7 } instead"? Now that I read more carefully, that appears to be how Jim DeLaHunt has interpreted the question.
– kwutchak
Nov 23 at 19:48






I believe I've been confused what you were after here, sorry about that. In your example above do the cells A1:A100 all contain a single fixed payment? That is, the spreadsheet equivalent of { 7 | 7 | 7 | 7 ... 95x ... 7 }. Is your question "What if I needed { 7 | 7 | 7 | 7 ... 100,995x ... 7 } instead"? Now that I read more carefully, that appears to be how Jim DeLaHunt has interpreted the question.
– kwutchak
Nov 23 at 19:48












3 Answers
3






active

oldest

votes

















up vote
2
down vote













I think you are asking Libreoffice Calc to do something it cannot do.



In LibreOffice Calc, an array is a "a linked range of cells on a spreadsheet containing values" (per Help article Array Functions). There is such a thing as an "Inline Array Constant", but that's for putting values into an array. IRR() is not an array function, it is a single-valued function which takes an array as an argument.



I think LibreOffice Calc wants to you allocate those 100 (or 100,000) cells with the same value.



You can populate the cells in various ways. I would put the value in the first cell, then give the second cell a formula that read from the first cell with an absolute reference, then fill that second cell down 100 (or 100,000) times to get the array I needed. All I have to change is the value in the first cell, and it gets propagated through the array.



If you really want to type a concise formula to calculate the Internal Rate of Return for 100,000 payments of the same amount, maybe LibreOffice isn't the best tool for the job. It's a spreadsheet. A programming language, like the Python language and the numpy.irr() function, might work better.






share|improve this answer





















  • Thank you, @jim-delahunt. I still find it odd that there's no elegant way to do what I need (without actually using n cells), so I'm not accepting your answer as the good one just yet, in case someone else weighs in on this.
    – tripu
    Jul 7 '17 at 13:45


















up vote
1
down vote













Yes, it is possible to write the array directly in your formula.

Calc refers to this as an "inline array constant".



A simple 3x2 example is



{1;2;3|"a";"b";"c"}.


Calc's Documentation has full details...






share|improve this answer























  • Again, my problem is that I may need to use a very long array. Imagine 300x2,000 instead. This syntax doesn't help with that.
    – tripu
    Nov 20 at 23:22


















up vote
0
down vote













Write a function which creates a repeating array based on cells in the spreadsheet.



I haven't written any code for Calc, so I'm not familiar with the syntax used, but in pseudo-code:



function repeat( value, amount ) -> { value | value | value ... value } 


... then call this code from IRR.



Alternatively, create a function that does everything:



function repeatIrr( value, amount ) -> value


... and call that from the spreadsheet.






share|improve this answer





















  • @tripu I assume this isn't what you are personally after (feel free to correct me on that!). I'm adding this answer in as it would be a solution, and may be acceptable to someone in a similar situation.
    – kwutchak
    Nov 23 at 20:05










  • ... personally if somebody else is interested in filling in the implementation details for Calc in this solution I'd love to see them!
    – kwutchak
    Nov 23 at 20:07











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1127609%2fhow-to-create-an-array-of-values-in-libreoffice-calc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













I think you are asking Libreoffice Calc to do something it cannot do.



In LibreOffice Calc, an array is a "a linked range of cells on a spreadsheet containing values" (per Help article Array Functions). There is such a thing as an "Inline Array Constant", but that's for putting values into an array. IRR() is not an array function, it is a single-valued function which takes an array as an argument.



I think LibreOffice Calc wants to you allocate those 100 (or 100,000) cells with the same value.



You can populate the cells in various ways. I would put the value in the first cell, then give the second cell a formula that read from the first cell with an absolute reference, then fill that second cell down 100 (or 100,000) times to get the array I needed. All I have to change is the value in the first cell, and it gets propagated through the array.



If you really want to type a concise formula to calculate the Internal Rate of Return for 100,000 payments of the same amount, maybe LibreOffice isn't the best tool for the job. It's a spreadsheet. A programming language, like the Python language and the numpy.irr() function, might work better.






share|improve this answer





















  • Thank you, @jim-delahunt. I still find it odd that there's no elegant way to do what I need (without actually using n cells), so I'm not accepting your answer as the good one just yet, in case someone else weighs in on this.
    – tripu
    Jul 7 '17 at 13:45















up vote
2
down vote













I think you are asking Libreoffice Calc to do something it cannot do.



In LibreOffice Calc, an array is a "a linked range of cells on a spreadsheet containing values" (per Help article Array Functions). There is such a thing as an "Inline Array Constant", but that's for putting values into an array. IRR() is not an array function, it is a single-valued function which takes an array as an argument.



I think LibreOffice Calc wants to you allocate those 100 (or 100,000) cells with the same value.



You can populate the cells in various ways. I would put the value in the first cell, then give the second cell a formula that read from the first cell with an absolute reference, then fill that second cell down 100 (or 100,000) times to get the array I needed. All I have to change is the value in the first cell, and it gets propagated through the array.



If you really want to type a concise formula to calculate the Internal Rate of Return for 100,000 payments of the same amount, maybe LibreOffice isn't the best tool for the job. It's a spreadsheet. A programming language, like the Python language and the numpy.irr() function, might work better.






share|improve this answer





















  • Thank you, @jim-delahunt. I still find it odd that there's no elegant way to do what I need (without actually using n cells), so I'm not accepting your answer as the good one just yet, in case someone else weighs in on this.
    – tripu
    Jul 7 '17 at 13:45













up vote
2
down vote










up vote
2
down vote









I think you are asking Libreoffice Calc to do something it cannot do.



In LibreOffice Calc, an array is a "a linked range of cells on a spreadsheet containing values" (per Help article Array Functions). There is such a thing as an "Inline Array Constant", but that's for putting values into an array. IRR() is not an array function, it is a single-valued function which takes an array as an argument.



I think LibreOffice Calc wants to you allocate those 100 (or 100,000) cells with the same value.



You can populate the cells in various ways. I would put the value in the first cell, then give the second cell a formula that read from the first cell with an absolute reference, then fill that second cell down 100 (or 100,000) times to get the array I needed. All I have to change is the value in the first cell, and it gets propagated through the array.



If you really want to type a concise formula to calculate the Internal Rate of Return for 100,000 payments of the same amount, maybe LibreOffice isn't the best tool for the job. It's a spreadsheet. A programming language, like the Python language and the numpy.irr() function, might work better.






share|improve this answer












I think you are asking Libreoffice Calc to do something it cannot do.



In LibreOffice Calc, an array is a "a linked range of cells on a spreadsheet containing values" (per Help article Array Functions). There is such a thing as an "Inline Array Constant", but that's for putting values into an array. IRR() is not an array function, it is a single-valued function which takes an array as an argument.



I think LibreOffice Calc wants to you allocate those 100 (or 100,000) cells with the same value.



You can populate the cells in various ways. I would put the value in the first cell, then give the second cell a formula that read from the first cell with an absolute reference, then fill that second cell down 100 (or 100,000) times to get the array I needed. All I have to change is the value in the first cell, and it gets propagated through the array.



If you really want to type a concise formula to calculate the Internal Rate of Return for 100,000 payments of the same amount, maybe LibreOffice isn't the best tool for the job. It's a spreadsheet. A programming language, like the Python language and the numpy.irr() function, might work better.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 25 '17 at 20:33









Jim DeLaHunt

22519




22519












  • Thank you, @jim-delahunt. I still find it odd that there's no elegant way to do what I need (without actually using n cells), so I'm not accepting your answer as the good one just yet, in case someone else weighs in on this.
    – tripu
    Jul 7 '17 at 13:45


















  • Thank you, @jim-delahunt. I still find it odd that there's no elegant way to do what I need (without actually using n cells), so I'm not accepting your answer as the good one just yet, in case someone else weighs in on this.
    – tripu
    Jul 7 '17 at 13:45
















Thank you, @jim-delahunt. I still find it odd that there's no elegant way to do what I need (without actually using n cells), so I'm not accepting your answer as the good one just yet, in case someone else weighs in on this.
– tripu
Jul 7 '17 at 13:45




Thank you, @jim-delahunt. I still find it odd that there's no elegant way to do what I need (without actually using n cells), so I'm not accepting your answer as the good one just yet, in case someone else weighs in on this.
– tripu
Jul 7 '17 at 13:45












up vote
1
down vote













Yes, it is possible to write the array directly in your formula.

Calc refers to this as an "inline array constant".



A simple 3x2 example is



{1;2;3|"a";"b";"c"}.


Calc's Documentation has full details...






share|improve this answer























  • Again, my problem is that I may need to use a very long array. Imagine 300x2,000 instead. This syntax doesn't help with that.
    – tripu
    Nov 20 at 23:22















up vote
1
down vote













Yes, it is possible to write the array directly in your formula.

Calc refers to this as an "inline array constant".



A simple 3x2 example is



{1;2;3|"a";"b";"c"}.


Calc's Documentation has full details...






share|improve this answer























  • Again, my problem is that I may need to use a very long array. Imagine 300x2,000 instead. This syntax doesn't help with that.
    – tripu
    Nov 20 at 23:22













up vote
1
down vote










up vote
1
down vote









Yes, it is possible to write the array directly in your formula.

Calc refers to this as an "inline array constant".



A simple 3x2 example is



{1;2;3|"a";"b";"c"}.


Calc's Documentation has full details...






share|improve this answer














Yes, it is possible to write the array directly in your formula.

Calc refers to this as an "inline array constant".



A simple 3x2 example is



{1;2;3|"a";"b";"c"}.


Calc's Documentation has full details...







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 at 20:23









zx485

632513




632513










answered Nov 15 at 20:08









kwutchak

267412




267412












  • Again, my problem is that I may need to use a very long array. Imagine 300x2,000 instead. This syntax doesn't help with that.
    – tripu
    Nov 20 at 23:22


















  • Again, my problem is that I may need to use a very long array. Imagine 300x2,000 instead. This syntax doesn't help with that.
    – tripu
    Nov 20 at 23:22
















Again, my problem is that I may need to use a very long array. Imagine 300x2,000 instead. This syntax doesn't help with that.
– tripu
Nov 20 at 23:22




Again, my problem is that I may need to use a very long array. Imagine 300x2,000 instead. This syntax doesn't help with that.
– tripu
Nov 20 at 23:22










up vote
0
down vote













Write a function which creates a repeating array based on cells in the spreadsheet.



I haven't written any code for Calc, so I'm not familiar with the syntax used, but in pseudo-code:



function repeat( value, amount ) -> { value | value | value ... value } 


... then call this code from IRR.



Alternatively, create a function that does everything:



function repeatIrr( value, amount ) -> value


... and call that from the spreadsheet.






share|improve this answer





















  • @tripu I assume this isn't what you are personally after (feel free to correct me on that!). I'm adding this answer in as it would be a solution, and may be acceptable to someone in a similar situation.
    – kwutchak
    Nov 23 at 20:05










  • ... personally if somebody else is interested in filling in the implementation details for Calc in this solution I'd love to see them!
    – kwutchak
    Nov 23 at 20:07















up vote
0
down vote













Write a function which creates a repeating array based on cells in the spreadsheet.



I haven't written any code for Calc, so I'm not familiar with the syntax used, but in pseudo-code:



function repeat( value, amount ) -> { value | value | value ... value } 


... then call this code from IRR.



Alternatively, create a function that does everything:



function repeatIrr( value, amount ) -> value


... and call that from the spreadsheet.






share|improve this answer





















  • @tripu I assume this isn't what you are personally after (feel free to correct me on that!). I'm adding this answer in as it would be a solution, and may be acceptable to someone in a similar situation.
    – kwutchak
    Nov 23 at 20:05










  • ... personally if somebody else is interested in filling in the implementation details for Calc in this solution I'd love to see them!
    – kwutchak
    Nov 23 at 20:07













up vote
0
down vote










up vote
0
down vote









Write a function which creates a repeating array based on cells in the spreadsheet.



I haven't written any code for Calc, so I'm not familiar with the syntax used, but in pseudo-code:



function repeat( value, amount ) -> { value | value | value ... value } 


... then call this code from IRR.



Alternatively, create a function that does everything:



function repeatIrr( value, amount ) -> value


... and call that from the spreadsheet.






share|improve this answer












Write a function which creates a repeating array based on cells in the spreadsheet.



I haven't written any code for Calc, so I'm not familiar with the syntax used, but in pseudo-code:



function repeat( value, amount ) -> { value | value | value ... value } 


... then call this code from IRR.



Alternatively, create a function that does everything:



function repeatIrr( value, amount ) -> value


... and call that from the spreadsheet.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 at 20:03









kwutchak

267412




267412












  • @tripu I assume this isn't what you are personally after (feel free to correct me on that!). I'm adding this answer in as it would be a solution, and may be acceptable to someone in a similar situation.
    – kwutchak
    Nov 23 at 20:05










  • ... personally if somebody else is interested in filling in the implementation details for Calc in this solution I'd love to see them!
    – kwutchak
    Nov 23 at 20:07


















  • @tripu I assume this isn't what you are personally after (feel free to correct me on that!). I'm adding this answer in as it would be a solution, and may be acceptable to someone in a similar situation.
    – kwutchak
    Nov 23 at 20:05










  • ... personally if somebody else is interested in filling in the implementation details for Calc in this solution I'd love to see them!
    – kwutchak
    Nov 23 at 20:07
















@tripu I assume this isn't what you are personally after (feel free to correct me on that!). I'm adding this answer in as it would be a solution, and may be acceptable to someone in a similar situation.
– kwutchak
Nov 23 at 20:05




@tripu I assume this isn't what you are personally after (feel free to correct me on that!). I'm adding this answer in as it would be a solution, and may be acceptable to someone in a similar situation.
– kwutchak
Nov 23 at 20:05












... personally if somebody else is interested in filling in the implementation details for Calc in this solution I'd love to see them!
– kwutchak
Nov 23 at 20:07




... personally if somebody else is interested in filling in the implementation details for Calc in this solution I'd love to see them!
– kwutchak
Nov 23 at 20:07


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1127609%2fhow-to-create-an-array-of-values-in-libreoffice-calc%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Сан-Квентин

8-я гвардейская общевойсковая армия

Алькесар