Extract Dates from 2 columns

Cowichandave

New Member
Joined
Jan 18, 2009
Messages
44
Office Version
  1. 2016
The attachment has 2 columns with dates. One is date joined, the other is date last active. The file contains 30 items First of all I want to extract only those active this year. This formula selects 18 active this year

Excel Formula:
=COUNTIFS($D$5:$D$34,">="&DATE(2023,1,1),$D$5:$D$34,"<="&DATE(2023,12,31))

Out of the 18 active I want the refine the formula to show who joined in 2021 and was active this year. The answer should be 8.
How do I do that?

Rolling Report TEMPLATE.xlsm
ABCD
4NumberIDJoinedActive
51MLS022023-01-162023-11-10
62ERM022023-05-032023-11-08
73HOM062023-04-202023-11-08
84JON032023-01-232023-11-08
95AUR062022-07-042023-11-10
106APE072022-06-202023-11-09
117BRO572022-06-272023-10-31
128DES182022-06-282023-10-31
139HEL042022-06-022023-10-31
1410LED622022-06-292023-10-31
1511CAN1072021-09-082023-11-10
1612ESC022021-06-082023-11-09
1713EAR032021-01-072023-11-09
1814MJL012021-02-042023-11-09
1915OBS032021-04-152023-11-08
2016CIV032021-05-282023-11-06
2117MEA062021-10-252023-11-06
2218RIV222021-08-162023-11-06
2319BEC012022-10-032022-12-30
2420PRI092022-08-252022-12-16
2521GofBC102021-07-282022-12-13
2622MRG032021-11-032022-12-12
2723AMA082021-02-192022-11-28
2824AKA022021-11-092022-11-08
2925ATB042017-03-102021-12-31
3026RCM1772011-09-212021-12-31
3127RDI022020-07-082021-12-31
3228SUM102006-10-232021-12-31
3329DRA182018-08-162021-12-24
3430TT0012004-08-162021-12-23
Sheet2
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
A power query solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Joined", type date}, {"Active", type date}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each Date.IsInCurrentYear([Active])),
    #"Extracted Year" = Table.TransformColumns(#"Filtered Rows",{{"Joined", Date.Year, Int64.Type}}),
    #"Filtered Rows1" = Table.SelectRows(#"Extracted Year", each ([Joined] = 2021))
in
    #"Filtered Rows1"
 
Upvote 0
A couple of formula options for each part.

23 11 19.xlsm
CDEFG
4JoinedActiveActive this yearActive this year & Joined 2021
52023-01-162023-11-10188
62023-05-032023-11-08188
72023-04-202023-11-08
82023-01-232023-11-08
92022-07-042023-11-10
102022-06-202023-11-09
112022-06-272023-10-31
122022-06-282023-10-31
132022-06-022023-10-31
142022-06-292023-10-31
152021-09-082023-11-10
162021-06-082023-11-09
172021-01-072023-11-09
182021-02-042023-11-09
192021-04-152023-11-08
202021-05-282023-11-06
212021-10-252023-11-06
222021-08-162023-11-06
232022-10-032022-12-30
242022-08-252022-12-16
252021-07-282022-12-13
262021-11-032022-12-12
272021-02-192022-11-28
282021-11-092022-11-08
292017-03-102021-12-31
302011-09-212021-12-31
312020-07-082021-12-31
322006-10-232021-12-31
332018-08-162021-12-24
342004-08-162021-12-23
Counts
Cell Formulas
RangeFormula
F5F5=COUNTIFS($D$5:$D$34,">="&DATE(2023,1,1),$D$5:$D$34,"<="&DATE(2023,12,31))
G5G5=COUNTIFS($D$5:$D$34,">="&DATE(2023,1,1),$D$5:$D$34,"<="&DATE(2023,12,31),$C$5:$C$34,">="&DATE(2021,1,1),$C$5:$C$34,"<="&DATE(2021,12,31))
F6F6=SUMPRODUCT(--(YEAR($D$5:$D$34)=2023))
G6G6=SUMPRODUCT((YEAR($D$5:$D$34)=2023)*(YEAR($C$5:$C$34)=2021))
 
Upvote 1
Solution

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

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