Formula to count values with unique values and different criteria

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
96
Office Version
  1. 365
[TABLE="width: 500"]
<tbody>[TR]
[TD]a
[/TD]
[TD]b
[/TD]
[TD]c
[/TD]
[TD]d
[/TD]
[TD]e
[/TD]
[TD]f
[/TD]
[/TR]
[TR]
[TD]123
[/TD]
[TD]John
[/TD]
[TD]Smith
[/TD]
[TD]01/01/2019
[/TD]
[TD]5/04/2019
[/TD]
[TD]No
[/TD]
[/TR]
[TR]
[TD]12345
[/TD]
[TD]Simon
[/TD]
[TD]Taylor
[/TD]
[TD]01/01/019
[/TD]
[TD]03/12/2018
[/TD]
[TD]No
[/TD]
[/TR]
[TR]
[TD]43433
[/TD]
[TD]June
[/TD]
[TD]Brown
[/TD]
[TD]01/01/2019
[/TD]
[TD]03/01/2019
[/TD]
[TD]Yes
[/TD]
[/TR]
[TR]
[TD]234
[/TD]
[TD]Paul
[/TD]
[TD]Baker
[/TD]
[TD]01/01/2019
[/TD]
[TD][/TD]
[TD]No
[/TD]
[/TR]
[TR]
[TD]12345
[/TD]
[TD]Rij
[/TD]
[TD]Veech
[/TD]
[TD]01/01/2019
[/TD]
[TD]03/03/019
[/TD]
[TD]No
[/TD]
[/TR]
</tbody>[/TABLE]

In Cell H1 I need a formula look down column F and ensure it looks for "No", then to look down column E3:E7 and where there is data, count column A3:A7. But I only need unique values. So in this case it would be 2.
In Cell H2 I need a formula look down column F and ensure is looks for "No", then to look down column E3:E7 and where there are blanks, count column A3:A7. But I only need unique values. So in this case it would be 1.
In Cell H3 I need to count all the cells in E3:E7 that contain data and column F also contains "No". This would be 3.
In Cell H4 I need to count all the cells in E3:E7 that are blank and column F also contains "No". This would be 1

Hope this makes sense.

Thanks in advance.
 
Try

Array formula
=SUM(IF(FREQUENCY(IF(B2:B20<>"",IF(C2:C20="NO",MATCH(A2:A20,A2:A20,0))),ROW(A2:A20)-ROW(A2)+1),1))
confirmed with Ctrl+Shift+Enter, not just Enter

M.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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