Lookup question

mhoss24

New Member
Using XL 2003

Im trying to determine how many Nos are tied to a certain subject.

Here is the format:

_| Subject | Y/N |
1 SUB1 YES
2 SUB2 YES
3 SUB1 NO
4 SUB1 YES
5 SUB2 NO

I have a dropdown on a different sheet where I can select a subject. I want to be able to determine how many nos pertain to each subject.
Example: When I select SUB1 from my dropdown, I want it to print out "1". Only problem is I have about 50 rows of yes/nos for about 10 different subjects. For a small sample I could use [[given that 'Sheet2'!\$A\$1 is my dropdown]]

=(IF(AND(A1='Sheet2'!\$A\$1, B1="NO"),1,0)+(A2='Sheet2'!\$A\$1, B2="NO"),1,0)+(A3='Sheet2'!\$A\$1, B3="NO"),1,0)+(A4='Sheet2'!\$A\$1, B4="NO"),1,0)+(A5='Sheet2'!\$A\$1, B5="NO"),1,0))

That's a really ugly way out, but the only thing that comes to my head for the moment and it will not work for a large sample like I have. Someone call me an idiot and tell me how to do this.

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

njimack

Well-known Member
=SUMPRODUCT(--(A1:A50=Sheet2!A1),--(B1:B50="NO"))

mhoss24

New Member
Thanks alot! I tried that before but I was selecting the entire A and B column. It spit back a "number error". When I selected only the cells, it works. Weird to me... You are of great help!

Best Regards,
Matthew

Replies
6
Views
392
Replies
14
Views
616
Replies
4
Views
277
Replies
7
Views
259
Replies
10
Views
488

1,191,587
Messages
5,987,512
Members
440,098
Latest member
MickyMouse123

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.

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

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