Simple Array Formula in Excel not comparing the right values












0















I'm trying to calculate with an Array Formula (in Cell D2) what i'm calculating in cell D11. The issue i'm having is that it appears my Array Formula is not evaluating the inputted array one-by-one. As an example, I want the second comparison that the formula does to be the following:



Check if ([B7>0] AND [C7=0]) and, if so, return D7.



But I think it's only checking to see if every value in the column B array is >0 and if every value in the column C array is =0.



The screenshot below details my problem. Thanks!



Here is the array formula: {SUM(IF(AND(B6:B10>0,C6:C10=0),B6:B10,0))}



Pic of my formulas










share|improve this question

























  • Please edit your question to provide your formula as text -- it will save everyone the effort of retyping them. That said, you may want to look into SUMIF and SUMIFS.

    – cybernetic.nomad
    Jan 16 at 17:00






  • 1





    SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)

    – Scott Craner
    Jan 16 at 23:14
















0















I'm trying to calculate with an Array Formula (in Cell D2) what i'm calculating in cell D11. The issue i'm having is that it appears my Array Formula is not evaluating the inputted array one-by-one. As an example, I want the second comparison that the formula does to be the following:



Check if ([B7>0] AND [C7=0]) and, if so, return D7.



But I think it's only checking to see if every value in the column B array is >0 and if every value in the column C array is =0.



The screenshot below details my problem. Thanks!



Here is the array formula: {SUM(IF(AND(B6:B10>0,C6:C10=0),B6:B10,0))}



Pic of my formulas










share|improve this question

























  • Please edit your question to provide your formula as text -- it will save everyone the effort of retyping them. That said, you may want to look into SUMIF and SUMIFS.

    – cybernetic.nomad
    Jan 16 at 17:00






  • 1





    SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)

    – Scott Craner
    Jan 16 at 23:14














0












0








0








I'm trying to calculate with an Array Formula (in Cell D2) what i'm calculating in cell D11. The issue i'm having is that it appears my Array Formula is not evaluating the inputted array one-by-one. As an example, I want the second comparison that the formula does to be the following:



Check if ([B7>0] AND [C7=0]) and, if so, return D7.



But I think it's only checking to see if every value in the column B array is >0 and if every value in the column C array is =0.



The screenshot below details my problem. Thanks!



Here is the array formula: {SUM(IF(AND(B6:B10>0,C6:C10=0),B6:B10,0))}



Pic of my formulas










share|improve this question
















I'm trying to calculate with an Array Formula (in Cell D2) what i'm calculating in cell D11. The issue i'm having is that it appears my Array Formula is not evaluating the inputted array one-by-one. As an example, I want the second comparison that the formula does to be the following:



Check if ([B7>0] AND [C7=0]) and, if so, return D7.



But I think it's only checking to see if every value in the column B array is >0 and if every value in the column C array is =0.



The screenshot below details my problem. Thanks!



Here is the array formula: {SUM(IF(AND(B6:B10>0,C6:C10=0),B6:B10,0))}



Pic of my formulas







microsoft-excel worksheet-function array






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 16 at 22:15









wysiwyg

2,028516




2,028516










asked Jan 16 at 16:56









AlanCurt1AlanCurt1

32




32













  • Please edit your question to provide your formula as text -- it will save everyone the effort of retyping them. That said, you may want to look into SUMIF and SUMIFS.

    – cybernetic.nomad
    Jan 16 at 17:00






  • 1





    SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)

    – Scott Craner
    Jan 16 at 23:14



















  • Please edit your question to provide your formula as text -- it will save everyone the effort of retyping them. That said, you may want to look into SUMIF and SUMIFS.

    – cybernetic.nomad
    Jan 16 at 17:00






  • 1





    SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)

    – Scott Craner
    Jan 16 at 23:14

















Please edit your question to provide your formula as text -- it will save everyone the effort of retyping them. That said, you may want to look into SUMIF and SUMIFS.

– cybernetic.nomad
Jan 16 at 17:00





Please edit your question to provide your formula as text -- it will save everyone the effort of retyping them. That said, you may want to look into SUMIF and SUMIFS.

– cybernetic.nomad
Jan 16 at 17:00




1




1





SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)

– Scott Craner
Jan 16 at 23:14





SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)

– Scott Craner
Jan 16 at 23:14










3 Answers
3






active

oldest

votes


















0














As Scott Craner said in his comment you can use SUMIFS.



=SUMIFS(B6:B10, B6:B10,">"&0, C6:C10,0)


This will SUM the values in B6:B10 where the rows match all of the following criteria. Here's a screenshot of it in action:



image






share|improve this answer
























  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:03











  • if you are adamant about using an array formula you can use this: SUM(IF(B6:B10>0,IF(C6:C10=0,B6:B10,0),0)) it works by only passing rows that meat the first IF criteria into the second IF statement

    – RickyTillson
    Jan 18 at 8:36





















0














Have you tried the non-array formula:



=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))


(with multiplication sign between parenthesis)






share|improve this answer


























  • Thanks for the comment. Can you please give more detail into what your suggested solution is? As you provided it, I can't type that into excel because the inputs for the sum function aren't values (at least that's what my Excel error message suggests.) EDIT: This is the output (#VALUE!) i'm getting: i.imgur.com/A54oMuw.png

    – AlanCurt1
    Jan 16 at 17:47





















0














SUMPRODUCT may be what you're looking for:



=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)


With your data, it returns 45






share|improve this answer
























  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:02











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%2f1395033%2fsimple-array-formula-in-excel-not-comparing-the-right-values%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









0














As Scott Craner said in his comment you can use SUMIFS.



=SUMIFS(B6:B10, B6:B10,">"&0, C6:C10,0)


This will SUM the values in B6:B10 where the rows match all of the following criteria. Here's a screenshot of it in action:



image






share|improve this answer
























  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:03











  • if you are adamant about using an array formula you can use this: SUM(IF(B6:B10>0,IF(C6:C10=0,B6:B10,0),0)) it works by only passing rows that meat the first IF criteria into the second IF statement

    – RickyTillson
    Jan 18 at 8:36


















0














As Scott Craner said in his comment you can use SUMIFS.



=SUMIFS(B6:B10, B6:B10,">"&0, C6:C10,0)


This will SUM the values in B6:B10 where the rows match all of the following criteria. Here's a screenshot of it in action:



image






share|improve this answer
























  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:03











  • if you are adamant about using an array formula you can use this: SUM(IF(B6:B10>0,IF(C6:C10=0,B6:B10,0),0)) it works by only passing rows that meat the first IF criteria into the second IF statement

    – RickyTillson
    Jan 18 at 8:36
















0












0








0







As Scott Craner said in his comment you can use SUMIFS.



=SUMIFS(B6:B10, B6:B10,">"&0, C6:C10,0)


This will SUM the values in B6:B10 where the rows match all of the following criteria. Here's a screenshot of it in action:



image






share|improve this answer













As Scott Craner said in his comment you can use SUMIFS.



=SUMIFS(B6:B10, B6:B10,">"&0, C6:C10,0)


This will SUM the values in B6:B10 where the rows match all of the following criteria. Here's a screenshot of it in action:



image







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 17 at 8:31









RickyTillsonRickyTillson

32718




32718













  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:03











  • if you are adamant about using an array formula you can use this: SUM(IF(B6:B10>0,IF(C6:C10=0,B6:B10,0),0)) it works by only passing rows that meat the first IF criteria into the second IF statement

    – RickyTillson
    Jan 18 at 8:36





















  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:03











  • if you are adamant about using an array formula you can use this: SUM(IF(B6:B10>0,IF(C6:C10=0,B6:B10,0),0)) it works by only passing rows that meat the first IF criteria into the second IF statement

    – RickyTillson
    Jan 18 at 8:36



















Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

– AlanCurt1
Jan 17 at 20:03





Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

– AlanCurt1
Jan 17 at 20:03













if you are adamant about using an array formula you can use this: SUM(IF(B6:B10>0,IF(C6:C10=0,B6:B10,0),0)) it works by only passing rows that meat the first IF criteria into the second IF statement

– RickyTillson
Jan 18 at 8:36







if you are adamant about using an array formula you can use this: SUM(IF(B6:B10>0,IF(C6:C10=0,B6:B10,0),0)) it works by only passing rows that meat the first IF criteria into the second IF statement

– RickyTillson
Jan 18 at 8:36















0














Have you tried the non-array formula:



=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))


(with multiplication sign between parenthesis)






share|improve this answer


























  • Thanks for the comment. Can you please give more detail into what your suggested solution is? As you provided it, I can't type that into excel because the inputs for the sum function aren't values (at least that's what my Excel error message suggests.) EDIT: This is the output (#VALUE!) i'm getting: i.imgur.com/A54oMuw.png

    – AlanCurt1
    Jan 16 at 17:47


















0














Have you tried the non-array formula:



=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))


(with multiplication sign between parenthesis)






share|improve this answer


























  • Thanks for the comment. Can you please give more detail into what your suggested solution is? As you provided it, I can't type that into excel because the inputs for the sum function aren't values (at least that's what my Excel error message suggests.) EDIT: This is the output (#VALUE!) i'm getting: i.imgur.com/A54oMuw.png

    – AlanCurt1
    Jan 16 at 17:47
















0












0








0







Have you tried the non-array formula:



=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))


(with multiplication sign between parenthesis)






share|improve this answer















Have you tried the non-array formula:



=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))


(with multiplication sign between parenthesis)







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 16 at 18:09









Worthwelle

2,71531325




2,71531325










answered Jan 16 at 17:44









pruvierospruvieros

1




1













  • Thanks for the comment. Can you please give more detail into what your suggested solution is? As you provided it, I can't type that into excel because the inputs for the sum function aren't values (at least that's what my Excel error message suggests.) EDIT: This is the output (#VALUE!) i'm getting: i.imgur.com/A54oMuw.png

    – AlanCurt1
    Jan 16 at 17:47





















  • Thanks for the comment. Can you please give more detail into what your suggested solution is? As you provided it, I can't type that into excel because the inputs for the sum function aren't values (at least that's what my Excel error message suggests.) EDIT: This is the output (#VALUE!) i'm getting: i.imgur.com/A54oMuw.png

    – AlanCurt1
    Jan 16 at 17:47



















Thanks for the comment. Can you please give more detail into what your suggested solution is? As you provided it, I can't type that into excel because the inputs for the sum function aren't values (at least that's what my Excel error message suggests.) EDIT: This is the output (#VALUE!) i'm getting: i.imgur.com/A54oMuw.png

– AlanCurt1
Jan 16 at 17:47







Thanks for the comment. Can you please give more detail into what your suggested solution is? As you provided it, I can't type that into excel because the inputs for the sum function aren't values (at least that's what my Excel error message suggests.) EDIT: This is the output (#VALUE!) i'm getting: i.imgur.com/A54oMuw.png

– AlanCurt1
Jan 16 at 17:47













0














SUMPRODUCT may be what you're looking for:



=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)


With your data, it returns 45






share|improve this answer
























  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:02
















0














SUMPRODUCT may be what you're looking for:



=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)


With your data, it returns 45






share|improve this answer
























  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:02














0












0








0







SUMPRODUCT may be what you're looking for:



=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)


With your data, it returns 45






share|improve this answer













SUMPRODUCT may be what you're looking for:



=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)


With your data, it returns 45







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 16 at 22:11









cybernetic.nomadcybernetic.nomad

1,795312




1,795312













  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:02



















  • Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

    – AlanCurt1
    Jan 17 at 20:02

















Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

– AlanCurt1
Jan 17 at 20:02





Thanks for the reply. I know that there are ways to do it without Array Formulas, but i'm using this example as an exercise to help me learn Array Formulas. How would I go about using Array Formulas to solve this?

– AlanCurt1
Jan 17 at 20:02


















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395033%2fsimple-array-formula-in-excel-not-comparing-the-right-values%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

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

RAC Tourist Trophy