How to enter an array formula within another formula











up vote
0
down vote

favorite












I have an Excel sheet, which holds timings for reports (when were they started, first handled, still open or already closed, ...).



For clarity in the Excel formulas, I've given a name to all columns, e.g.:




  • name All_Still_Open : the column Still_Open contains TRUE or FALSE, a formula result.

  • name All_Start_Dates : the column Start Date contains the starting date of the reports.


I'd like to know the average time a report is still open. Therefore I have following array formula:



{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


(The curly brackets are entered using Ctrl+Shift+Enter)



This is working fine, but my department has been working very hard, and now no report is open anymore. As a result of this, the formula gives a division by zero error code, which I don't want: I'd like to see the value 0 instead.



I've tried to put an IF-clause around it, but this doesn't work: the if-clause seems to make it impossible to turn this into an array formula.



I'd like something like the following:



=IF(<condition>;0;{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


=> Mind the curly brackets.



Is this possible using standard Excel or do I need to write my own function for this (which I prefer to avoid for readability reasons)? (It seems that adding the curly brackets myself, without using Ctrl+Shift+Enter, does not work.










share|improve this question






















  • Try IFERROR if its available to you. IF(your formula, what to do if an error)". Remember only one = sign per line. So {=IFERROR(AVERAGE...)}. Also depending on your version of excel, there is now apparently AVERAGEIF if I recall correctly.
    – Forward Ed
    Nov 28 at 12:59

















up vote
0
down vote

favorite












I have an Excel sheet, which holds timings for reports (when were they started, first handled, still open or already closed, ...).



For clarity in the Excel formulas, I've given a name to all columns, e.g.:




  • name All_Still_Open : the column Still_Open contains TRUE or FALSE, a formula result.

  • name All_Start_Dates : the column Start Date contains the starting date of the reports.


I'd like to know the average time a report is still open. Therefore I have following array formula:



{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


(The curly brackets are entered using Ctrl+Shift+Enter)



This is working fine, but my department has been working very hard, and now no report is open anymore. As a result of this, the formula gives a division by zero error code, which I don't want: I'd like to see the value 0 instead.



I've tried to put an IF-clause around it, but this doesn't work: the if-clause seems to make it impossible to turn this into an array formula.



I'd like something like the following:



=IF(<condition>;0;{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


=> Mind the curly brackets.



Is this possible using standard Excel or do I need to write my own function for this (which I prefer to avoid for readability reasons)? (It seems that adding the curly brackets myself, without using Ctrl+Shift+Enter, does not work.










share|improve this question






















  • Try IFERROR if its available to you. IF(your formula, what to do if an error)". Remember only one = sign per line. So {=IFERROR(AVERAGE...)}. Also depending on your version of excel, there is now apparently AVERAGEIF if I recall correctly.
    – Forward Ed
    Nov 28 at 12:59















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have an Excel sheet, which holds timings for reports (when were they started, first handled, still open or already closed, ...).



For clarity in the Excel formulas, I've given a name to all columns, e.g.:




  • name All_Still_Open : the column Still_Open contains TRUE or FALSE, a formula result.

  • name All_Start_Dates : the column Start Date contains the starting date of the reports.


I'd like to know the average time a report is still open. Therefore I have following array formula:



{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


(The curly brackets are entered using Ctrl+Shift+Enter)



This is working fine, but my department has been working very hard, and now no report is open anymore. As a result of this, the formula gives a division by zero error code, which I don't want: I'd like to see the value 0 instead.



I've tried to put an IF-clause around it, but this doesn't work: the if-clause seems to make it impossible to turn this into an array formula.



I'd like something like the following:



=IF(<condition>;0;{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


=> Mind the curly brackets.



Is this possible using standard Excel or do I need to write my own function for this (which I prefer to avoid for readability reasons)? (It seems that adding the curly brackets myself, without using Ctrl+Shift+Enter, does not work.










share|improve this question













I have an Excel sheet, which holds timings for reports (when were they started, first handled, still open or already closed, ...).



For clarity in the Excel formulas, I've given a name to all columns, e.g.:




  • name All_Still_Open : the column Still_Open contains TRUE or FALSE, a formula result.

  • name All_Start_Dates : the column Start Date contains the starting date of the reports.


I'd like to know the average time a report is still open. Therefore I have following array formula:



{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


(The curly brackets are entered using Ctrl+Shift+Enter)



This is working fine, but my department has been working very hard, and now no report is open anymore. As a result of this, the formula gives a division by zero error code, which I don't want: I'd like to see the value 0 instead.



I've tried to put an IF-clause around it, but this doesn't work: the if-clause seems to make it impossible to turn this into an array formula.



I'd like something like the following:



=IF(<condition>;0;{=AVERAGE(IF(All_Still_Open;TODAY()-All_Start_Dates))}


=> Mind the curly brackets.



Is this possible using standard Excel or do I need to write my own function for this (which I prefer to avoid for readability reasons)? (It seems that adding the curly brackets myself, without using Ctrl+Shift+Enter, does not work.







microsoft-excel worksheet-function






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 28 at 9:29









Dominique

57611028




57611028












  • Try IFERROR if its available to you. IF(your formula, what to do if an error)". Remember only one = sign per line. So {=IFERROR(AVERAGE...)}. Also depending on your version of excel, there is now apparently AVERAGEIF if I recall correctly.
    – Forward Ed
    Nov 28 at 12:59




















  • Try IFERROR if its available to you. IF(your formula, what to do if an error)". Remember only one = sign per line. So {=IFERROR(AVERAGE...)}. Also depending on your version of excel, there is now apparently AVERAGEIF if I recall correctly.
    – Forward Ed
    Nov 28 at 12:59


















Try IFERROR if its available to you. IF(your formula, what to do if an error)". Remember only one = sign per line. So {=IFERROR(AVERAGE...)}. Also depending on your version of excel, there is now apparently AVERAGEIF if I recall correctly.
– Forward Ed
Nov 28 at 12:59






Try IFERROR if its available to you. IF(your formula, what to do if an error)". Remember only one = sign per line. So {=IFERROR(AVERAGE...)}. Also depending on your version of excel, there is now apparently AVERAGEIF if I recall correctly.
– Forward Ed
Nov 28 at 12:59

















active

oldest

votes











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%2f1379025%2fhow-to-enter-an-array-formula-within-another-formula%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















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%2f1379025%2fhow-to-enter-an-array-formula-within-another-formula%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

Plaza Victoria

In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...