COUNTIF with DATES

sparky2205

Well-known Member
Joined
Feb 6, 2013
Messages
508
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi folks,
I have a spreadsheet with 2 tabs. See below.
Sheet1 contains Date Issued in Column B. This is in custom date format dd-mmm-yy.
Sheet 2 contains a summary of the results of Sheet1.
What I am trying to do is summarise in the table in Sheet2 by number of records issued by quarter.
To do this I am trying to compare the last 2 digits of the year in Sheet2 B1 with the last 2 digits of the values in Sheet1 Column B.
I am doing this in a COUNTIF.
But it appears RIGHT returns the last 2 digits of the date serial number from Column B while returning the last 2 digits of the actual date from Sheet2, which is causing a mismatch.
I would appreciate any assistance with this.

MREXCEL1.xlsx
AB
1No.Date Issued
2105-Nov-19
3218-Nov-19
4318-Nov-19
5425-Nov-19
6505-Dec-19
7612-Dec-19
8713-Dec-19
9808-Jan-20
10910-Jan-20
111022-Jan-20
121111-Feb-20
131211-Feb-20
141303-Mar-20
151406-Apr-20
161523-Apr-20
171618-May-20
181725-May-20
191803-Jul-20
201923-Jul-20
212020-Aug-20
222131-Aug-20
232204-Jan-21
242307-Jan-21
252412-Jan-21
262502-Mar-21
272615-Apr-21
282711-Mar-21
292811-Mar-21
302916-Mar-21
313015-Apr-21
323121-May-21
333216-Apr-21
343330-Apr-21
353412-May-21
363511-May-21
373626-Apr-21
383720-Aug-21
393807-Jan-22
403903-Feb-22
414011-Mar-22
424103-Mar-22
434207-Mar-22
444329-Apr-22
454416-Aug-22
464504-Apr-22
474621-Apr-22
484713-Apr-22
494826-Jul-22
504911-Oct-22
515021-Apr-22
525121-Apr-22
535209-Jan-23
545318-Jan-23
555403-Apr-23
565520-Jan-23
575601-Feb-23
585727-Jun-23
595801-Feb-23
605914-Jun-23
616006-Mar-23
626108-May-23
636215-Mar-23
646319-Apr-23
656428-Mar-23
666503-Apr-23
676627-Mar-23
686711-Apr-23
696802-Jan-24
706919-Feb-24
717016-Jan-24
727113-Feb-24
737219-Feb-24
747326-Feb-24
757426-Feb-24
767519-Feb-24
777622-Mar-24
787726-Mar-24
797822-Mar-24
807911-Apr-24
818029-Apr-24
828110-Apr-24
838205-May-24
848315-May-24
858429-Apr-24
868529-Apr-24
Sheet1


MREXCEL1.xlsx
ABCDE
1Review Year2025Last used row86
2MonthCurrently Open
3Q1 2025
4Q2 2025
5Q3 2025
6Q4 2025
Sheet2
Cell Formulas
RangeFormula
E1E1=LOOKUP(2,1/(NOT(ISBLANK(Sheet1!A:A))),ROW(Sheet1!A:A))
C3C3= "Q1 " & $B$1
C4C4= "Q2 " & $B$1
C5C5= "Q3 " & $B$1
C6C6= "Q4 " & $B$1
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I'll let you right the formula, but instead of comparing the last two digits, compare the Year from Sheet 1 to the last 4 on sheet 2. You may also need to compare the month from the Sheet1 dates as well to the quarter number (month 1, 2, and 3 will be Q1, etc).
 
Upvote 0
Try:
Book2
ABCDE
1Review Year2025Last used row86
2MonthCurrently Open
3Q1 20250
4Q2 20250
5Q3 20250
6Q4 20250
Sheet8
Cell Formulas
RangeFormula
E1E1=LOOKUP(2,1/(NOT(ISBLANK(Sheet1!A:A))),ROW(Sheet1!A:A))
C3C3= "Q1 " & $B$1
D3:D6D3=SUM(--("Q"&ROUNDUP(MONTH(Sheet1!$B$2:$B$86)/3,0)&" "&YEAR(Sheet1!$B$2:$B$86)=C3))
C4C4= "Q2 " & $B$1
C5C5= "Q3 " & $B$1
C6C6= "Q4 " & $B$1
 
Upvote 0

Forum statistics

Threads
1,225,627
Messages
6,186,100
Members
453,337
Latest member
fiaz ahmad

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