Simple Array Formula in Excel not comparing the right values
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))}
microsoft-excel worksheet-function array
add a comment |
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))}
microsoft-excel worksheet-function array
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 intoSUMIF
andSUMIFS
.
– cybernetic.nomad
Jan 16 at 17:00
1
SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)
– Scott Craner
Jan 16 at 23:14
add a comment |
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))}
microsoft-excel worksheet-function array
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))}
microsoft-excel worksheet-function array
microsoft-excel worksheet-function array
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 intoSUMIF
andSUMIFS
.
– cybernetic.nomad
Jan 16 at 17:00
1
SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)
– Scott Craner
Jan 16 at 23:14
add a comment |
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 intoSUMIF
andSUMIFS
.
– 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
add a comment |
3 Answers
3
active
oldest
votes
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:
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
add a comment |
Have you tried the non-array formula:
=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))
(with multiplication sign between parenthesis)
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
add a comment |
SUMPRODUCT
may be what you're looking for:
=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)
With your data, it returns 45
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:
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
add a comment |
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:
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
add a comment |
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:
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:
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
add a comment |
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
add a comment |
Have you tried the non-array formula:
=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))
(with multiplication sign between parenthesis)
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
add a comment |
Have you tried the non-array formula:
=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))
(with multiplication sign between parenthesis)
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
add a comment |
Have you tried the non-array formula:
=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))
(with multiplication sign between parenthesis)
Have you tried the non-array formula:
=SUM((B6:B10>0)*(C6:C10=0)*(C6:C10))
(with multiplication sign between parenthesis)
edited Jan 16 at 18:09
Worthwelle
2,70031325
2,70031325
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
add a comment |
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
add a comment |
SUMPRODUCT
may be what you're looking for:
=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)
With your data, it returns 45
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
add a comment |
SUMPRODUCT
may be what you're looking for:
=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)
With your data, it returns 45
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
add a comment |
SUMPRODUCT
may be what you're looking for:
=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)
With your data, it returns 45
SUMPRODUCT
may be what you're looking for:
=SUMPRODUCT(--(B6:B10>0),--(C6:C10=0),B6:B10)
With your data, it returns 45
answered Jan 16 at 22:11
cybernetic.nomadcybernetic.nomad
1,773312
1,773312
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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
andSUMIFS
.– cybernetic.nomad
Jan 16 at 17:00
1
SUMIFS(B6:B10,B6:B10,">0",C6:C10,0)
– Scott Craner
Jan 16 at 23:14