COUNTIFS or maybe VLOOKUP

RodneyW

Active Member
Joined
Sep 24, 2010
Messages
433
Office Version
  1. 2013
Platform
  1. Windows
My sheet named "Data" has a range of dates in column B that include MM/DD/YY as in 1/01/2022, 1/03/2022, 1/03/22, 1/06/2022, 3/06/2022 and so on.

My sheet named "Dashboard" in column B has the entire month as in 1/01/2022, 2/01/2022, 3/01/2022 and so on, it doesn't include the day but rather all days are considered "01".

B4 of this sheet has 1/01/22. In C4 of this sheet I need a formula that will look in Data $B:$B for anything and COUNT everything 1/01/2022 - 1/31-2022 and give me that number. Using the data in the first line of this post, the formula would produce 4 as the result. (note there are two entries for 1/03/2022)

I'm using this formula: =COUNTIFS(Data!$B:$B,">=1/01/22",Data!$B:$B,"<=1/31/22") and it works but I have to move down cell by cell and change the formula to =COUNTIFS(Data!$B:$B,">=2/01/22",Data!$B:$B,"<=2/28/22") and =COUNTIFS(Data!$B:$B,">=3/01/22",Data!$B:$B,"<=3/31/22") and so on, over and over. This is doable, but it's time consuming, especially if I need to go back several years.

Is there an alternative way to do this so a formula looks for anything in Data!$B:$B that includes anything that includes the MM/YY that are in column B of Dashboard?

Thanks in advance
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Assuming the dates in the "Data" sheet:
Dante Amor
ABC
1DATE
201/01/2022
301/03/2022
401/03/2022
501/06/2022
603/06/2022
703/07/2022
803/10/2022
904/15/2022
10
Data


Try the following in the Dashboard sheet:
Dante Amor
ABC
1
2
3MONTHCOUNT
401/01/20224
502/01/20220
603/01/20223
704/01/20221
805/01/20220
906/01/20220
1007/01/20220
1108/01/20220
1209/01/20220
1310/01/20220
1411/01/20220
1512/01/20220
Dashboard
Cell Formulas
RangeFormula
C4:C15C4=COUNTIFS(Data!B:B,">="&B4,Data!B:B,"<="&EOMONTH(B4,0))


--------------
Let me know the result and I'll get back to you as soon as I can.
Cordially
Dante Amor
--------------
 
Upvote 0
Solution
Assuming the dates in the "Data" sheet:
Dante Amor
ABC
1DATE
201/01/2022
301/03/2022
401/03/2022
501/06/2022
603/06/2022
703/07/2022
803/10/2022
904/15/2022
10
Data


Try the following in the Dashboard sheet:
Dante Amor
ABC
1
2
3MONTHCOUNT
401/01/20224
502/01/20220
603/01/20223
704/01/20221
805/01/20220
906/01/20220
1007/01/20220
1108/01/20220
1209/01/20220
1310/01/20220
1411/01/20220
1512/01/20220
Dashboard
Cell Formulas
RangeFormula
C4:C15C4=COUNTIFS(Data!B:B,">="&B4,Data!B:B,"<="&EOMONTH(B4,0))


--------------
Let me know the result and I'll get back to you as soon as I can.
Cordially
Dante Amor
--------------
Worked like a charm THANK YOU
 
Upvote 0
Worked like a charm THANK YOU
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,954
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