Array Function with Dates

RaviWildcat

Board Regular
Joined
Jun 18, 2010
Messages
119
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello Excel Experts!

I've got a column of dates, formatted as Day, Date, Year. And, I'd like to count all the Sundays using an array formula (like countif)

So,

Sunday, January 6, 2019
Monday, January 7, 2019
Tuesday, January 8, 2019

etc.

It's easy as pie to create a helper column, just adjacent to these dates (text(c167,"Dddd"), and then create a countif using the helper column (countif(B100:b200,"Sunday")

What would be the syntax for creating this without a helper column?

I figured it might be a CSE function like {COUNTIFS(C34:C167,LEFT(TEXT($C$34:$C$167,"Dddd"),3)="Sun")} but that doesn't work and I'm not sure why?

Any ideas?

Thanks,
Ravi
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try:

=SUMPRODUCT(--(WEEKDAY(C34:C167)=1))

The COUNTIFS doesn't work since you're not following the syntax, the first parameter must be a range, the second a constant, not a function.
 
Last edited:
Upvote 0
Thank you Eric! I'll need to bone up on my sum products (and the countifs too!)
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,079
Members
449,094
Latest member
mystic19

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