Excel: Count cells in matrix with multiple conditions












1














I have a table table1 with a matrix of n columns [[column_1]:[column_n]] that contain dates or empty fields.

Also there's a column [number] with integers.



I want to count all cells that contain a date in the past AND are in a row where the corresponding number is 0. How do I do that?



Only the first condition is easy: =COUNTIF(Table1[[column_1]:[column_n]];"<"&TODAY())

But I don't get it to only consider rows in which the integer is 0.



I know there's probably an approach using array functions, but I can't figure it out. Searching on google was to no avail.

Thanks for your help!










share|improve this question


















  • 1




    Unfortunately Excel is not good at working with 2D ranges and lists at the same time. You need to count the values by row (=COUNTIF(Table1[@[column_1]:[column_n]];"<"&TODAY())*(table1[@[number]]=0)) and summarize them in a second step. (Don't forget the @ in the formula)
    – Máté Juhász
    Nov 23 '18 at 12:24












  • Well, thanks! I guess there is a limit of what you can do without VBA, but good to know.
    – ColdBrew
    Nov 24 '18 at 9:47


















1














I have a table table1 with a matrix of n columns [[column_1]:[column_n]] that contain dates or empty fields.

Also there's a column [number] with integers.



I want to count all cells that contain a date in the past AND are in a row where the corresponding number is 0. How do I do that?



Only the first condition is easy: =COUNTIF(Table1[[column_1]:[column_n]];"<"&TODAY())

But I don't get it to only consider rows in which the integer is 0.



I know there's probably an approach using array functions, but I can't figure it out. Searching on google was to no avail.

Thanks for your help!










share|improve this question


















  • 1




    Unfortunately Excel is not good at working with 2D ranges and lists at the same time. You need to count the values by row (=COUNTIF(Table1[@[column_1]:[column_n]];"<"&TODAY())*(table1[@[number]]=0)) and summarize them in a second step. (Don't forget the @ in the formula)
    – Máté Juhász
    Nov 23 '18 at 12:24












  • Well, thanks! I guess there is a limit of what you can do without VBA, but good to know.
    – ColdBrew
    Nov 24 '18 at 9:47
















1












1








1







I have a table table1 with a matrix of n columns [[column_1]:[column_n]] that contain dates or empty fields.

Also there's a column [number] with integers.



I want to count all cells that contain a date in the past AND are in a row where the corresponding number is 0. How do I do that?



Only the first condition is easy: =COUNTIF(Table1[[column_1]:[column_n]];"<"&TODAY())

But I don't get it to only consider rows in which the integer is 0.



I know there's probably an approach using array functions, but I can't figure it out. Searching on google was to no avail.

Thanks for your help!










share|improve this question













I have a table table1 with a matrix of n columns [[column_1]:[column_n]] that contain dates or empty fields.

Also there's a column [number] with integers.



I want to count all cells that contain a date in the past AND are in a row where the corresponding number is 0. How do I do that?



Only the first condition is easy: =COUNTIF(Table1[[column_1]:[column_n]];"<"&TODAY())

But I don't get it to only consider rows in which the integer is 0.



I know there's probably an approach using array functions, but I can't figure it out. Searching on google was to no avail.

Thanks for your help!







microsoft-excel worksheet-function






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 23 '18 at 11:49









ColdBrew

82




82








  • 1




    Unfortunately Excel is not good at working with 2D ranges and lists at the same time. You need to count the values by row (=COUNTIF(Table1[@[column_1]:[column_n]];"<"&TODAY())*(table1[@[number]]=0)) and summarize them in a second step. (Don't forget the @ in the formula)
    – Máté Juhász
    Nov 23 '18 at 12:24












  • Well, thanks! I guess there is a limit of what you can do without VBA, but good to know.
    – ColdBrew
    Nov 24 '18 at 9:47
















  • 1




    Unfortunately Excel is not good at working with 2D ranges and lists at the same time. You need to count the values by row (=COUNTIF(Table1[@[column_1]:[column_n]];"<"&TODAY())*(table1[@[number]]=0)) and summarize them in a second step. (Don't forget the @ in the formula)
    – Máté Juhász
    Nov 23 '18 at 12:24












  • Well, thanks! I guess there is a limit of what you can do without VBA, but good to know.
    – ColdBrew
    Nov 24 '18 at 9:47










1




1




Unfortunately Excel is not good at working with 2D ranges and lists at the same time. You need to count the values by row (=COUNTIF(Table1[@[column_1]:[column_n]];"<"&TODAY())*(table1[@[number]]=0)) and summarize them in a second step. (Don't forget the @ in the formula)
– Máté Juhász
Nov 23 '18 at 12:24






Unfortunately Excel is not good at working with 2D ranges and lists at the same time. You need to count the values by row (=COUNTIF(Table1[@[column_1]:[column_n]];"<"&TODAY())*(table1[@[number]]=0)) and summarize them in a second step. (Don't forget the @ in the formula)
– Máté Juhász
Nov 23 '18 at 12:24














Well, thanks! I guess there is a limit of what you can do without VBA, but good to know.
– ColdBrew
Nov 24 '18 at 9:47






Well, thanks! I guess there is a limit of what you can do without VBA, but good to know.
– ColdBrew
Nov 24 '18 at 9:47












1 Answer
1






active

oldest

votes


















0














Switch to SUMPRODUCT:



=SUMPRODUCT((Table1[[column_1]:[column_n]]<TODAY())*(Table1[number]=0))



Regards






share|improve this answer





















  • That seems like the way to go! And it returns a reasonable value, except that it also counts empty cells as dates that lie in the future. Is there a way to omit those?
    – ColdBrew
    Nov 27 '18 at 22:01










  • Ok, I found a solution for this. (albeit not very elegant) =SUMPRODUCT((IF(ISEMPTY(Table1[[column_1]:[column_n]]);FALSE();Table1[[column_1]:[column_n]])<TODAY())*(Table1[number]=0)) I'll still count your solution as correct, as it answered my original question
    – ColdBrew
    Nov 27 '18 at 22:08













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',
autoActivateHeartbeat: false,
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%2f1377789%2fexcel-count-cells-in-matrix-with-multiple-conditions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Switch to SUMPRODUCT:



=SUMPRODUCT((Table1[[column_1]:[column_n]]<TODAY())*(Table1[number]=0))



Regards






share|improve this answer





















  • That seems like the way to go! And it returns a reasonable value, except that it also counts empty cells as dates that lie in the future. Is there a way to omit those?
    – ColdBrew
    Nov 27 '18 at 22:01










  • Ok, I found a solution for this. (albeit not very elegant) =SUMPRODUCT((IF(ISEMPTY(Table1[[column_1]:[column_n]]);FALSE();Table1[[column_1]:[column_n]])<TODAY())*(Table1[number]=0)) I'll still count your solution as correct, as it answered my original question
    – ColdBrew
    Nov 27 '18 at 22:08


















0














Switch to SUMPRODUCT:



=SUMPRODUCT((Table1[[column_1]:[column_n]]<TODAY())*(Table1[number]=0))



Regards






share|improve this answer





















  • That seems like the way to go! And it returns a reasonable value, except that it also counts empty cells as dates that lie in the future. Is there a way to omit those?
    – ColdBrew
    Nov 27 '18 at 22:01










  • Ok, I found a solution for this. (albeit not very elegant) =SUMPRODUCT((IF(ISEMPTY(Table1[[column_1]:[column_n]]);FALSE();Table1[[column_1]:[column_n]])<TODAY())*(Table1[number]=0)) I'll still count your solution as correct, as it answered my original question
    – ColdBrew
    Nov 27 '18 at 22:08
















0












0








0






Switch to SUMPRODUCT:



=SUMPRODUCT((Table1[[column_1]:[column_n]]<TODAY())*(Table1[number]=0))



Regards






share|improve this answer












Switch to SUMPRODUCT:



=SUMPRODUCT((Table1[[column_1]:[column_n]]<TODAY())*(Table1[number]=0))



Regards







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 24 '18 at 16:10









XOR LX

1,05757




1,05757












  • That seems like the way to go! And it returns a reasonable value, except that it also counts empty cells as dates that lie in the future. Is there a way to omit those?
    – ColdBrew
    Nov 27 '18 at 22:01










  • Ok, I found a solution for this. (albeit not very elegant) =SUMPRODUCT((IF(ISEMPTY(Table1[[column_1]:[column_n]]);FALSE();Table1[[column_1]:[column_n]])<TODAY())*(Table1[number]=0)) I'll still count your solution as correct, as it answered my original question
    – ColdBrew
    Nov 27 '18 at 22:08




















  • That seems like the way to go! And it returns a reasonable value, except that it also counts empty cells as dates that lie in the future. Is there a way to omit those?
    – ColdBrew
    Nov 27 '18 at 22:01










  • Ok, I found a solution for this. (albeit not very elegant) =SUMPRODUCT((IF(ISEMPTY(Table1[[column_1]:[column_n]]);FALSE();Table1[[column_1]:[column_n]])<TODAY())*(Table1[number]=0)) I'll still count your solution as correct, as it answered my original question
    – ColdBrew
    Nov 27 '18 at 22:08


















That seems like the way to go! And it returns a reasonable value, except that it also counts empty cells as dates that lie in the future. Is there a way to omit those?
– ColdBrew
Nov 27 '18 at 22:01




That seems like the way to go! And it returns a reasonable value, except that it also counts empty cells as dates that lie in the future. Is there a way to omit those?
– ColdBrew
Nov 27 '18 at 22:01












Ok, I found a solution for this. (albeit not very elegant) =SUMPRODUCT((IF(ISEMPTY(Table1[[column_1]:[column_n]]);FALSE();Table1[[column_1]:[column_n]])<TODAY())*(Table1[number]=0)) I'll still count your solution as correct, as it answered my original question
– ColdBrew
Nov 27 '18 at 22:08






Ok, I found a solution for this. (albeit not very elegant) =SUMPRODUCT((IF(ISEMPTY(Table1[[column_1]:[column_n]]);FALSE();Table1[[column_1]:[column_n]])<TODAY())*(Table1[number]=0)) I'll still count your solution as correct, as it answered my original question
– ColdBrew
Nov 27 '18 at 22:08




















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%2f1377789%2fexcel-count-cells-in-matrix-with-multiple-conditions%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

AnyDesk - Fatal Program Failure

How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

QoS: MAC-Priority for clients behind a repeater