Count ifs function using filter

edsashley

New Member
Joined
Jun 11, 2024
Messages
12
Office Version
  1. 365
Platform
  1. Windows
I have been using the formula =COUNTIFS(F:F,"<>e-learning*",F:F,"*",H:H,"*") to extract data from a work sheet which works fine.

I now want to filter by location, shown in the ‘D’ column. I have just added D:D,$N$16 to the formula to give;

=COUNTIFS(D:D,$N$16,F:F,"<>e-learning*",F:F,"*",H:H,"*")

Where the location is inputted in N16 using a drop down box.

This works fine but I would like to ignore =(D:D,$N$16) if N16 is left blank.

Can anyone help me with this.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
have a try:
VBA Code:
=COUNTIFS(D:D,IF($N$16="","*",$N$16),F:F,"<>e-learning*",F:F,"*",H:H,"*")
 
Upvote 0
have a try:
VBA Code:
=COUNTIFS(D:D,IF($N$16="","*",$N$16),F:F,"<>e-learning*",F:F,"*",H:H,"*")
Worked almost perfectly thanks. The only issue I have now is the numbers are thrown by the header. Can we ‘-1’ if ‘H1’ reads status?
 
Upvote 0
Is there a special way I have to input date into the N16 cell where I want 2 variables to show.

ie before I had for example London north and London south as two variables. I have now entered into the cell ‘London. London north, London south’ in the hopes that this will filter by both north and south instead of two separate filters.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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