Count formula with condition

Muhammad Asif 121 Reputation points
2022-11-02T08:06:09.04+00:00

I have an Excel sheet and want to count cell B value with the condition of Cell A.
for example, I have data like that
cell A cell B cell C
Google 1 Google
Google 1
Facebook 1
how am use a formula to count google values in the entire sheet and also Facebook values with the required condition?
when cell c1 is equal to google it compare the value of cell C with cell A and count all value of cell B of Google.

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,639 questions
{count} votes

Accepted answer
  1. Emi Zhang-MSFT 21,706 Reputation points Microsoft Vendor
    2022-11-03T07:20:43.943+00:00

    Hi @Muhammad Asif ,
    Do you want to SUM the values in cell B?
    You can try this formula:

    =SUMPRODUCT(($A$1:$A$3=C1)*($B$1:$B$3))  
    

    256630-image.png

    If you want to Count the values in cell B, try this formula:

    =SUMPRODUCT(($A$1:$A$3=C1)*(B1:B3>0)*1)  
    

    256696-image.png

    Just checking in to see if the information was helpful. Please let us know if you would like further assistance.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful