MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 3rd, 2002, 08:39 AM   #1
snedman
New Member
 
Join Date: May 2002
Location: Baton Rouge
Posts: 39
Default

I am at a call center and need to calculate how many calls that we are taking on Sundays.

the dates are in the format 5/01/02 in B7:B200 there are of course 4 Sundays in May 5/5/02
5/12/02
5/19/02
5/26/02

Is there a way to count the number of Sundays in the B column, so that it counts all instances of sunday dates of:
5/5/02
5/12/02
5/19/02
5/26/02

Thank you all very much in advance.

Snedman
snedman is offline   Reply With Quote
Old May 3rd, 2002, 08:44 AM   #2
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

assuming a range of a1:b5, with dates in A and calls in B, you could use

=SUMPRODUCT((WEEKDAY(A1:A5)=1)*(B1:B5))

good luck
IML is offline   Reply With Quote
Old May 3rd, 2002, 09:02 AM   #3
snedman
New Member
 
Join Date: May 2002
Location: Baton Rouge
Posts: 39
Default

I just want to count the actual dates for Sunday. That would be the easiest way.

the dates are B5:B200. I just want it to count all of the times in Columb B that it find the dates of:
5/5/02
5/12/02
5/19/02
5/26/02
in total so that if it sees the date 5/26/02 5 times, 5/12/02 5 times, and 5/5/02 4 times it would say it found those instances 14 times. Thank you for your patience
snedman is offline   Reply With Quote
Old May 3rd, 2002, 09:15 AM   #4
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
Default

Quote:
On 2002-05-03 08:02, snedman wrote:
I just want to count the actual dates for Sunday. That would be the easiest way.

the dates are B5:B200. I just want it to count all of the times in Columb B that it find the dates of:
5/5/02
5/12/02
5/19/02
5/26/02
in total so that if it sees the date 5/26/02 5 times, 5/12/02 5 times, and 5/5/02 4 times it would say it found those instances 14 times. Thank you for your patience
=SUMPRODUCT((WEEKDAY(B5:B200)=1)+0)

Aladin Akyurek is offline   Reply With Quote
Old May 3rd, 2002, 09:19 AM   #5
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

edit - I total misunderstood, this would appear to work if...

If you want to find out how many sundays in a month given a date, give

=INT(((DATE(YEAR(A1),MONTH(A1)+1,1))-(DATE(YEAR(A1),MONTH(A1),1)+7-(WEEKDAY(DATE(YEAR(A1),MONTH(A1),1),2))))/7)+1

a try. A1 is a date. Not fully tested, but it appears to work. Good luck.

[ This Message was edited by: IML on 2002-05-03 08:21 ]
IML is offline   Reply With Quote
Old May 3rd, 2002, 09:33 AM   #6
snedman
New Member
 
Join Date: May 2002
Location: Baton Rouge
Posts: 39
Default

Awesome, It works, it works. You are all awesome Thank You, Thank You

Snedman
snedman is offline   Reply With Quote
Old May 3rd, 2002, 09:39 AM   #7
g_erhard
New Member
 
Join Date: Mar 2002
Location: San Ramon CA
Posts: 23
Default

Quote:
On 2002-05-03 08:02, snedman wrote:
I just want to count the actual dates for Sunday. That would be the easiest way.

the dates are B5:B200. I just want it to count all of the times in Columb B that it find the dates of:
5/5/02
5/12/02
5/19/02
5/26/02
in total so that if it sees the date 5/26/02 5 times, 5/12/02 5 times, and 5/5/02 4 times it would say it found those instances 14 times. Thank you for your patience
(I'm not going to post a formula; two have already been posted that work fine.)

Breakdown of Problem:
Given a range of datestamps for calls taken, determine how many occurred on Sundays.

Solution:
Excel has the ability (using the Weekday function) to tell you what day of the week a given date falls on.

Weekday(A1)

Now, the result is a NUMBER. 1 for Sundays, 2 for Mondays, 3 for Tuesdays, etc. That gives us the next part of the problem, our logical test.

Weekday(A1)=1 | Sunday = TRUE | Any other day = FALSE

So, if you set up a formula (or multiple formulas) to examine each date in your range, and only 'count' those that fall on Sundays, you should get your answer.

Now, if you KNOW BEFOREHAND which dates specifically fall on Sunday, then you can write formulae to see if the date falls within a given set, and go from there. But the Weekday solution will not limit you to a predefined date range; the formula will work without rewriting even if you run the same report for the next month, or year, or decade.
g_erhard is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:54 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes