COUNTIFS with multiple ifs and within date-range

pasjauo

New Member
Joined
May 1, 2017
Messages
49
Hey all you geniuses,

I'm really struggling with a COUNTIFS formula, and I hope you can help.

DateError type 1Error type 2Error type 3Size

<tbody>
</tbody>

Columns are A,B,C,D,E in this example

This is my setup. The premise is that the user will choose some problems which will show in the 3 error type columns. What is tricky is that the same problem can be present in error type 1 in one row and then in error type 3 in the next row.

What I have done so far (where the date was not an issue) was to use COUNTIFS to filter in the size to each known error (i have around 23 errors). Something like this:

Code:
=COUNTIFS($B:$B;"problem 1";$E:$E;"Large")+COUNTIFS($C:$C;"problem 1";$E:$E;"Large")+COUNTIFS($D:$D;"problem 1";$E:$E;"Large")

It might not be pretty but it works at least.

Here comes the tricky part. I have added the date column and would now want to filter each month out so i can make statistics for each month instead of just the total.

I have tried to add two criterias (above for instance 1/1/2018 and below 1/31/2018). This does not work.

Code:
=COUNTIFS($B:$B;"problem 1";$E:$E;"Large";$A:$A;">=1/1/2018";$A:$A;"<=1/31/2018")

I can manipulated my data so there is definitely one match on that formula if it had worked. It does show a 0 though. My language in excel is not english, meaning the syntax might not look english but it is the correct form.

What am I doing wrong?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I have been digging more in to it myself, since I really dont know why it doesn't work.

Code:
=COUNTIFS($B:$B;"problem 1";$E:$E;"Large";$A:$A;"=1/1/2018")

The above code works if the date is exactly 1/1/2018. If I do a <=1/2/2018 it fails again. So it seems it is the <> that creates the problem.
 
Upvote 0
Try replacing
Code:
">=1/1/2018"

with

Code:
">="&(date(2018,1,1))

Same problem occurs. If I do like you say it doesnt work. If i remove > and set the date to the right date in the column it works. So the syntax works but there is something wrong with the <=> apparently.
 
Upvote 0
Presumably you followed my suggestion for ALL the dates in your COUNTIFS formula, not just one ?

Yes. To make sure I did not make any errors i simplified the formula so it for instance only searched for >=1/1/2018 if you know what i mean. Even a COUNTIF with only 1 criteria didnt work, so its not because I forgot something in a long formula unfortunately.
 
Upvote 0
Can you please post the latest version of the formula that you have ?

This is the exact formula i use (with no translation):

Code:
=TÆL.HVISER(Automater1!$K:$K;"="&A24;Automater1!$A:$A;">="&(DATO(2018;1;1)))

I guess most of it makes sense translation wise but let me know if you have troubles. Most different is probably the ; instead of the english , to seperate.
 
Upvote 0
Assuming that DOES mean the same as COUNTIFS, then this formula works as expected . . . .

Code:
=COUNTIFS(Automater1!$K:$K,"="&A24,Automater1!$A:$A,">="&DATE(2018,1,1))

In other words, counts how many rows on the "Automater1" sheet have a date in column A that is greater than 1/1/2018, AND have an entry in column K that exactly matches the value in cell A24.
A24 refers to the same sheet that the formula is entered into, and not "Automater1".
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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