Add a CountIF to a SumProduct Formula












0















In a previous question, Scott gave me this great formula to sum all the sales from salespeople who saw an increase in sales from 2017 to 2018:



=SUMPRODUCT(C2:C9-B2:B9, --(C2:C9>B2:B9), --(B2:B9>0))


Now I need a formula that counts how many salespeople saw an increase in sales from 2017 to 2018. I've fiddled around CountIF, but I'm still a novice with these advanced formulas, so I couldn't figure it out.



Here is sample data:



**A**---------------**B**--------------**C**---- 
**Salesman**----**2017 sales**---**2018 sales**
Todd Packer----------$14,547---------$15,487
Michael Scott--------$26,487---------$24,491
Dwight Schrutte------$19,124---------$19,458
Phyllis Vance--------$13,891---------$14,551
Stanley Hudson-------$17,541---------$17,541
Jim Halpert----------$15,874---------$15,732
Andy Bernard--------------$0----------$9,574
Pam Beasley-----------$2,123--------------$0


Todd, Dwight and Phyllis each saw an increase in their sales, so the result I'm looking for is 3. I want to ignore Andy since he had no activity in 2017.










share|improve this question























  • You will add a "helper column" in this case. The helper column will be =IF(2018 sales - 2017 sales >0,"x","") which will then place an x (or whatever character you want) if the sales increased. Then simply do a COUNTIF like you were looking at where the condition is "x" (or the character you chose)

    – Eric F
    Jan 15 at 15:43













  • Is there a way to do it without a helper column?

    – OzzyKP
    Jan 15 at 15:55
















0















In a previous question, Scott gave me this great formula to sum all the sales from salespeople who saw an increase in sales from 2017 to 2018:



=SUMPRODUCT(C2:C9-B2:B9, --(C2:C9>B2:B9), --(B2:B9>0))


Now I need a formula that counts how many salespeople saw an increase in sales from 2017 to 2018. I've fiddled around CountIF, but I'm still a novice with these advanced formulas, so I couldn't figure it out.



Here is sample data:



**A**---------------**B**--------------**C**---- 
**Salesman**----**2017 sales**---**2018 sales**
Todd Packer----------$14,547---------$15,487
Michael Scott--------$26,487---------$24,491
Dwight Schrutte------$19,124---------$19,458
Phyllis Vance--------$13,891---------$14,551
Stanley Hudson-------$17,541---------$17,541
Jim Halpert----------$15,874---------$15,732
Andy Bernard--------------$0----------$9,574
Pam Beasley-----------$2,123--------------$0


Todd, Dwight and Phyllis each saw an increase in their sales, so the result I'm looking for is 3. I want to ignore Andy since he had no activity in 2017.










share|improve this question























  • You will add a "helper column" in this case. The helper column will be =IF(2018 sales - 2017 sales >0,"x","") which will then place an x (or whatever character you want) if the sales increased. Then simply do a COUNTIF like you were looking at where the condition is "x" (or the character you chose)

    – Eric F
    Jan 15 at 15:43













  • Is there a way to do it without a helper column?

    – OzzyKP
    Jan 15 at 15:55














0












0








0








In a previous question, Scott gave me this great formula to sum all the sales from salespeople who saw an increase in sales from 2017 to 2018:



=SUMPRODUCT(C2:C9-B2:B9, --(C2:C9>B2:B9), --(B2:B9>0))


Now I need a formula that counts how many salespeople saw an increase in sales from 2017 to 2018. I've fiddled around CountIF, but I'm still a novice with these advanced formulas, so I couldn't figure it out.



Here is sample data:



**A**---------------**B**--------------**C**---- 
**Salesman**----**2017 sales**---**2018 sales**
Todd Packer----------$14,547---------$15,487
Michael Scott--------$26,487---------$24,491
Dwight Schrutte------$19,124---------$19,458
Phyllis Vance--------$13,891---------$14,551
Stanley Hudson-------$17,541---------$17,541
Jim Halpert----------$15,874---------$15,732
Andy Bernard--------------$0----------$9,574
Pam Beasley-----------$2,123--------------$0


Todd, Dwight and Phyllis each saw an increase in their sales, so the result I'm looking for is 3. I want to ignore Andy since he had no activity in 2017.










share|improve this question














In a previous question, Scott gave me this great formula to sum all the sales from salespeople who saw an increase in sales from 2017 to 2018:



=SUMPRODUCT(C2:C9-B2:B9, --(C2:C9>B2:B9), --(B2:B9>0))


Now I need a formula that counts how many salespeople saw an increase in sales from 2017 to 2018. I've fiddled around CountIF, but I'm still a novice with these advanced formulas, so I couldn't figure it out.



Here is sample data:



**A**---------------**B**--------------**C**---- 
**Salesman**----**2017 sales**---**2018 sales**
Todd Packer----------$14,547---------$15,487
Michael Scott--------$26,487---------$24,491
Dwight Schrutte------$19,124---------$19,458
Phyllis Vance--------$13,891---------$14,551
Stanley Hudson-------$17,541---------$17,541
Jim Halpert----------$15,874---------$15,732
Andy Bernard--------------$0----------$9,574
Pam Beasley-----------$2,123--------------$0


Todd, Dwight and Phyllis each saw an increase in their sales, so the result I'm looking for is 3. I want to ignore Andy since he had no activity in 2017.







microsoft-excel worksheet-function countif






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 15 at 15:31









OzzyKPOzzyKP

93




93













  • You will add a "helper column" in this case. The helper column will be =IF(2018 sales - 2017 sales >0,"x","") which will then place an x (or whatever character you want) if the sales increased. Then simply do a COUNTIF like you were looking at where the condition is "x" (or the character you chose)

    – Eric F
    Jan 15 at 15:43













  • Is there a way to do it without a helper column?

    – OzzyKP
    Jan 15 at 15:55



















  • You will add a "helper column" in this case. The helper column will be =IF(2018 sales - 2017 sales >0,"x","") which will then place an x (or whatever character you want) if the sales increased. Then simply do a COUNTIF like you were looking at where the condition is "x" (or the character you chose)

    – Eric F
    Jan 15 at 15:43













  • Is there a way to do it without a helper column?

    – OzzyKP
    Jan 15 at 15:55

















You will add a "helper column" in this case. The helper column will be =IF(2018 sales - 2017 sales >0,"x","") which will then place an x (or whatever character you want) if the sales increased. Then simply do a COUNTIF like you were looking at where the condition is "x" (or the character you chose)

– Eric F
Jan 15 at 15:43







You will add a "helper column" in this case. The helper column will be =IF(2018 sales - 2017 sales >0,"x","") which will then place an x (or whatever character you want) if the sales increased. Then simply do a COUNTIF like you were looking at where the condition is "x" (or the character you chose)

– Eric F
Jan 15 at 15:43















Is there a way to do it without a helper column?

– OzzyKP
Jan 15 at 15:55





Is there a way to do it without a helper column?

– OzzyKP
Jan 15 at 15:55










1 Answer
1






active

oldest

votes


















0














Use SUMPRODUCT:



To count the salespeople whose sales increased:



=SUMPRODUCT(--(C2:C9>B2:B9),--(B2:B9>0))


(this formulas will ignore salespeople whose initial results (column B) were 0)



To count the ones whose sales decreased:



=SUMPRODUCT(--(C2:C9<B2:B9),--(C2:C9>0))


(this formulas will ignore salespeople whose final results (column C) were 0)






share|improve this answer
























  • Awesome, that did it. Thanks!!

    – OzzyKP
    Jan 15 at 17:29











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%2f1394573%2fadd-a-countif-to-a-sumproduct-formula%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














Use SUMPRODUCT:



To count the salespeople whose sales increased:



=SUMPRODUCT(--(C2:C9>B2:B9),--(B2:B9>0))


(this formulas will ignore salespeople whose initial results (column B) were 0)



To count the ones whose sales decreased:



=SUMPRODUCT(--(C2:C9<B2:B9),--(C2:C9>0))


(this formulas will ignore salespeople whose final results (column C) were 0)






share|improve this answer
























  • Awesome, that did it. Thanks!!

    – OzzyKP
    Jan 15 at 17:29
















0














Use SUMPRODUCT:



To count the salespeople whose sales increased:



=SUMPRODUCT(--(C2:C9>B2:B9),--(B2:B9>0))


(this formulas will ignore salespeople whose initial results (column B) were 0)



To count the ones whose sales decreased:



=SUMPRODUCT(--(C2:C9<B2:B9),--(C2:C9>0))


(this formulas will ignore salespeople whose final results (column C) were 0)






share|improve this answer
























  • Awesome, that did it. Thanks!!

    – OzzyKP
    Jan 15 at 17:29














0












0








0







Use SUMPRODUCT:



To count the salespeople whose sales increased:



=SUMPRODUCT(--(C2:C9>B2:B9),--(B2:B9>0))


(this formulas will ignore salespeople whose initial results (column B) were 0)



To count the ones whose sales decreased:



=SUMPRODUCT(--(C2:C9<B2:B9),--(C2:C9>0))


(this formulas will ignore salespeople whose final results (column C) were 0)






share|improve this answer













Use SUMPRODUCT:



To count the salespeople whose sales increased:



=SUMPRODUCT(--(C2:C9>B2:B9),--(B2:B9>0))


(this formulas will ignore salespeople whose initial results (column B) were 0)



To count the ones whose sales decreased:



=SUMPRODUCT(--(C2:C9<B2:B9),--(C2:C9>0))


(this formulas will ignore salespeople whose final results (column C) were 0)







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 15 at 15:58









cybernetic.nomadcybernetic.nomad

1,493112




1,493112













  • Awesome, that did it. Thanks!!

    – OzzyKP
    Jan 15 at 17:29



















  • Awesome, that did it. Thanks!!

    – OzzyKP
    Jan 15 at 17:29

















Awesome, that did it. Thanks!!

– OzzyKP
Jan 15 at 17:29





Awesome, that did it. Thanks!!

– OzzyKP
Jan 15 at 17:29


















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%2f1394573%2fadd-a-countif-to-a-sumproduct-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

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix