Countifs with OR criteria

CarolynS

Board Regular
Joined
Oct 27, 2015
Messages
56
Hi

I'm trying to write a formula to count records that have a start date that falls between certain dates and either no end date (i.e. blank) OR an end date greater than X date. I've come up with the below formula but Excel is saying there's somehting wring with the formula:

=sum(countifs('Course Export'!D:D,{"",">"&Commands!E8},'Course Export'!H:H,">="&Commands!E10,'Course Export'!H:H,"<="&Commands!E11,))

The cell references in the Commands tab relate to dates.

Thanks in advance :)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
You can only put 'constant' values in a {constant array}, no variables.

I'd suggest a helper column, say column J for example
J2 and filled down
=OR(D2="",D2>Commands!E$8)

Then use
COUNTIFS('Course Export'!J:J,TRUE,'Course Export'!H:H,">="&Commands!E10,'Course Export'!H:H,"<="&Commands!E11)
 
Upvote 0
Or maybe this

=SUMPRODUCT(COUNTIFS('Course Export'!D:D,CHOOSE({1,2},"",">"&Commands!E8),'Course Export'!H:H,">="&Commands!E10,'Course Export'!H:H,"<="&Commands!E11))

M.
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,115
Members
452,545
Latest member
boybenqn

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