Count number of rows where two columns values are matching and third column is null.

deekhari

New Member
Joined
Feb 5, 2016
Messages
1
Hi All,

I have a very strange condition where I have to get my answer in a single cell.
Note: I do not want to populate any randome cell and refer that in my cell function.

See the below table:

COLA COLB COLC COLD
123 123 Y
223 223 Y
223 223 Y
123 10-12-2010 123 Y
333 333 N

I need to COUNT number of columns where below condition met:
1) COLA=COLC
2) COLB is NULL
3) COLC having values in list (123,223)
4) COLD = "Y"

I have been using two function, but all four conditions are not met in both:

=SUMPRODUCT(--(COLC2:COLC6=COLA2:COLA6),--(COLD2:COLD6="Y"),--(COLB2:COL6<>"*"))

here I am not able to incoorporate condition 3)

=SUM(COUNTIFS(COLB2:COLB6,"=",COLD2:COLD6,"Y",COLC2:COLC6,{123;223}))
here I am not able to incorporate condition 1)

Please help me with this problem.

Thanks and Regards,
Dee
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
=SUMPRODUCT(--(C2:C6=A2:A6),--(D2:D6="Y"),--(B2:B6=""),COUNTIF(myList,C2:C6))

note that I've changed the column B condition, as your requirement states it must be NULL and I wasn't getting that using <>"*"

you'll need a named range called myList, containing your values 123,223 etc
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,931
Members
449,480
Latest member
yesitisasport

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