Using day of week in another formula

normpam

Active Member
Joined
Oct 30, 2002
Messages
360
I know that =text(a2,"Dddd") will give me a day of the week, and can also use the WEEKDAY function. Is it possible to use one of these within another formula?

Example

A2:A7700 has a bunch of dates. i want to calculate how many Sundays, Mondays, etc. there are in the list. I guess I could use a formula in a separate cell to get the days, and then use a COUNT function, but was trying to do it in one formula.

Any ideas?

Thanks!
 

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.
Try something like this (for Sundays):
Code:
=SUMPRODUCT(--(WEEKDAY(A2:A7700)=1))
 
Upvote 0
Thanks... got the idea, though I almost never think about using SUMPRODUCT. I've also seen before what the double dash does, though can't remember its name. One problem though. In my real data there are 7,625 records. There could be more in another imported sheet, so I went up to 7,700. But the formula is calculating a total number of results (7,699) even though there are only 7,625 records.
 
Upvote 0
Was thinking that maybe an array formula might do the trick, but not sure how to set it up....
 
Upvote 0
But the formula is calculating a total number of results (7,699)
I am confused. It shouldn't return 7699 unless every date in A2:A7700 is a Sunday.

Did you modify the formula? If so, what exactly do you have?

Are the entries in column A really dates, or strings masquerading as dates?
(What does the formula =ISNUMBER(A2) return?)

What appears after the end of the data in column A? Is it just blank cells?
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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