Using vlookup with countif

Farhan Noor

New Member
Joined
Aug 1, 2018
Messages
1
In sheet 1, column A - I have a column listed with some name, suppose
Bill
Jordan
James

In sheet 2, column A - I have all the names of sheet 1 column A multiple times.
In sheet 2 column B - there are two results "yes" and "No" for each names. Suppose,
Bill ------------------yes
Jordan -------------No
James--------------No
Bill--------------------yes
James--------------yes
Bill--------------------yes
Bill--------------------No

Now, in sheet 1, column B - I want to put how many times each name got "yes" in sheet 2, column B. Suppose,
Bill ------------- 3
James---------1

I think for this I have to do vlookup and countif together but don't know how to do. I would be very much pleased if anyone help me do this.
Thanks in advance.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
You can just do this with a CountIfs formula, try this:

Code:
=COUNTIFS(Sheet2!A1:A20,A1,Sheet2!B1:B20,"yes")

Change the ranges for A1:A20 and B1:B20 to be whatever your specific ranges are on Sheet-2. Put the formula in sheet1 column-B and then copy down, it will look at the name from sheet1 and then look at sheet-2 for a matching name and the word "yes".
 
Upvote 0
Assuming Sheet1 column "A" is the list of name
B1 = =SUMPRODUCT((Sheet2!$B$2:$B$8="yes")*(Sheet2!$A$2:$A$8=Sheet1!$A1))
Copy and paste down

Do you know that a Pivot Table could do the job
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,659
Messages
6,126,074
Members
449,286
Latest member
Lantern

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top