Count Year within different date formats

jubilee101

New Member
Joined
Apr 17, 2013
Messages
25
I have a worksheet with a column which holds project due dates.
Format differs as below, depending on accuracy of finish date of project at current moment.
Apr-18 (Custom Date)
Aug-18 (Custom Date)
2018 - (general format)
Q4 2018 - (general format)

I am using a countifs formula to apply several criteria, with column AF holding the data above. I want to count anything that is in 2018 or -18 or 18
The formula below only counts line items with 2018.

=COUNTIFS('Projects'!A:A,"Yes",'Projects'!B:B,"Yes",'Projects'!C:C,"No",'Projects'!AF:AF,"*18*")

Is this possible? :confused:
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
If they are held as Excel internal dates (5-digit numbers) the year as 18 or 2018 won't get picked up.
You'd have to convert them using TEXT(A1,"yyyy") something like that
 
Upvote 0
You probably need SUMPRODUCT cos of the TEXT() on a range

Try
=SUMPRODUCT(--('Projects'!A:A="Yes")*('Projects'!B:B="Yes")*('Projects'!C:C="No")*(TEXT('Projects'!AF:AF,"yyyy"=2018))
 
Upvote 0
That gives me a #value error. so still not seeing them (thanks for the help by the way)
 
Last edited:
Upvote 0
Oops!
Should be this

=SUMPRODUCT(--('Projects'!A:A="Yes")*('Projects'!B:B="Yes")*('Projects'!C:C="No")*(TEXT('Projects'!AF:AF,"yyyy")=2018))

Note closing bracket on "yyyy"

You will get a VALUE error if your dates are a mixture of numbers and text
 
Last edited:
Upvote 0
Ok I tried that and get a zero. Should be over 20.

So what I did was create a new column , set cell format as text and have manually typed everything in. all text, but still looks like
Apr-18
2018
Q4 2018

It's still not counting the 18's
Could I use IF RIGHT formula in some way?
 
Upvote 0
Can you PM me the file if possible?
If the data is sensitive I would just need the AF column copied into a blank sheet
 
Upvote 0
#6
Try putting the 2018 as "2018"

Text function changes the numeric value to text Format.

Not sure if this the solution.....but try :)
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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