Countifs with dates

MarcBeideler

New Member
Joined
Jan 26, 2021
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
Hello,

First of all I want you to apologize my bad english, it's not my first language.

My problem:
I have a list with 3 columns and 100 rows.

Column A category with articles named for example X, Y, Z
Column B containing the entry date of the article
Column C containing the exit date of the article

I need now a formula for a table in witch I could count the article X where the difference between entry and exit date is less or equal 1 year.
Please note the the entry dates are different.
Actually I had a formula in a different column where an IF-formula looked in every row if the conditions are true by giving a result or leaving empty but I thought that it would be better without that additional column.

I've tried with DATE(YEAR()+1,MONTH(),DAY() but it doesn't return a result.

Thanks for your help

Unfortunately it's impossible for me to upload a sheet from my work-computer
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Here an image, as it's not possible to upload the file
 

Attachments

  • Capture.JPG
    Capture.JPG
    69.1 KB · Views: 11
Upvote 0
@MarcBeideler Does the below help?

Book7
ABCD
1TotalXYZ
2In033
3Out200
4Out 1 Year200
5
6
7
8CategoryInOut
9X4/21/215/21/21
10X4/24/214/25/21
11Y10/25/22
12Y11/21/22
13Y11/21/22
14Z11/21/22
15Z11/21/22
16Z11/21/22
17
Counts
Cell Formulas
RangeFormula
B2:D2B2=COUNTIFS($A9:$A20,B1,$B9:$B20,">0",$C9:$C20,"")
B3:D3B3=COUNTIFS($A9:$A20,B1,$C9:$C20,">0")
B4:D4B4=SUMPRODUCT(($A9:$A20=B$1)*($C9:$C20>0)*($C9:$C20<=($B9:$B20+365)))
 
Upvote 0
Solution
@MarcBeideler Does the below help?

Book7
ABCD
1TotalXYZ
2In033
3Out200
4Out 1 Year200
5
6
7
8CategoryInOut
9X4/21/215/21/21
10X4/24/214/25/21
11Y10/25/22
12Y11/21/22
13Y11/21/22
14Z11/21/22
15Z11/21/22
16Z11/21/22
17
Counts
Cell Formulas
RangeFormula
B2:D2B2=COUNTIFS($A9:$A20,B1,$B9:$B20,">0",$C9:$C20,"")
B3:D3B3=COUNTIFS($A9:$A20,B1,$C9:$C20,">0")
B4:D4B4=SUMPRODUCT(($A9:$A20=B$1)*($C9:$C20>0)*($C9:$C20<=($B9:$B20+365)))
Thank you,

no it don't work.
Result was in my table 0 and it should be 2

Thank you
 
Upvote 0
@MarcBeideler Does the below help?

Book7
ABCD
1TotalXYZ
2In033
3Out200
4Out 1 Year200
5
6
7
8CategoryInOut
9X4/21/215/21/21
10X4/24/214/25/21
11Y10/25/22
12Y11/21/22
13Y11/21/22
14Z11/21/22
15Z11/21/22
16Z11/21/22
17
Counts
Cell Formulas
RangeFormula
B2:D2B2=COUNTIFS($A9:$A20,B1,$B9:$B20,">0",$C9:$C20,"")
B3:D3B3=COUNTIFS($A9:$A20,B1,$C9:$C20,">0")
B4:D4B4=SUMPRODUCT(($A9:$A20=B$1)*($C9:$C20>0)*($C9:$C20<=($B9:$B20+365)))
Sorry, I saw my error in the formula, yes it works, thank you
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

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