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 4th, 2002, 07:37 AM   #1
verluc
Board Regular
 
Join Date: Mar 2002
Posts: 1,289
Default

I have a sheet with the dates of a month.
Ex.Month JANUARY 2002

1 2 3 4 5 6 7 8 9 10 11 ..... 31

How can I get the day of the week automaticly:

Ex.Mont JANUARY 2002

1 2 3 4 5 6 7 8 9 10 11 ..... 31
TU WE TH FR SA SU MO TU WE TH FR ..... TH

Thanks for help.
verluc is online now   Reply With Quote
Old May 4th, 2002, 07:47 AM   #2
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

I made some assumptions -
Month in A1
Year in B1
days in row a1-???

Use the formula
=TEXT(($A$1&" "&A2&", "&$B$1)+0,"dddd")
in A3 and copy it accross. If need be, you can wrap an iserror statement around this to avoid errors in months with less than 31 days.

EDITED FORMULA -

you could use
=LEFT(TEXT(($A$1&" "&A2&", "&$B$1)+0,"ddd"),2)

for the two digit code you are looking for.

[ This Message was edited by: IML on 2002-05-04 06:49 ]
IML is offline   Reply With Quote
Old May 4th, 2002, 07:48 AM   #3
sen_edp
Board Regular
 
sen_edp's Avatar
 
Join Date: Mar 2002
Location: Hellas
Posts: 553
Default

hello verluc

you have to format the cells this way

dddd


__________________
Best Regards
Andreas
sen_edp is offline   Reply With Quote
Old May 4th, 2002, 08:20 AM   #4
verluc
Board Regular
 
Join Date: Mar 2002
Posts: 1,289
Default

Quote:
On 2002-05-04 06:47, IML wrote:
I made some assumptions -
Month in A1
Year in B1
days in row a1-???

Use the formula
=TEXT(($A$1&" "&A2&", "&$B$1)+0,"dddd")
in A3 and copy it accross. If need be, you can wrap an iserror statement around this to avoid errors in months with less than 31 days.

EDITED FORMULA -

you could use
=LEFT(TEXT(($A$1&" "&A2&", "&$B$1)+0,"ddd"),2)

for the two digit code you are looking for.

[ This Message was edited by: IML on 2002-05-04 06:49 ]
Thay's not what I mean.
I have in cell C3 : january 2002
I have in cell D7 : 1
Now those two elements give me 01.01.2002
IN want to know what 01.01.2002 is : TUESDAY
en so on untill the last day of the month.
Thank you in advance.
verluc is online now   Reply With Quote
Old May 4th, 2002, 08:31 AM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-05-04 07:20, verluc wrote:
Quote:
On 2002-05-04 06:47, IML wrote:
I made some assumptions -
Month in A1
Year in B1
days in row a1-???

Use the formula
=TEXT(($A$1&" "&A2&", "&$B$1)+0,"dddd")
in A3 and copy it accross. If need be, you can wrap an iserror statement around this to avoid errors in months with less than 31 days.

EDITED FORMULA -

you could use
=LEFT(TEXT(($A$1&" "&A2&", "&$B$1)+0,"ddd"),2)

for the two digit code you are looking for.

[ This Message was edited by: IML on 2002-05-04 06:49 ]
Thay's not what I mean.
I have in cell C3 : january 2002
I have in cell D7 : 1
Now those two elements give me 01.01.2002
IN want to know what 01.01.2002 is : TUESDAY
en so on untill the last day of the month.
Thank you in advance.
What is the result of:

=ISNUMBER(C3)


And, you state: Now those two elements give me 01.01.2002

You already have computed 01.01.2002 in some cell? If so, what is the result of:

=ISNUMBER(the-cell-that-contains-01.01.2002)



[ This Message was edited by: Aladin Akyurek on 2002-05-04 07:37 ]
Aladin Akyurek is offline   Reply With Quote
Old May 4th, 2002, 09:37 AM   #6
verluc
Board Regular
 
Join Date: Mar 2002
Posts: 1,289
Default

Quote:
On 2002-05-04 07:31, Aladin Akyurek wrote:
Quote:
On 2002-05-04 07:20, verluc wrote:
Quote:
On 2002-05-04 06:47, IML wrote:
I made some assumptions -
Month in A1
Year in B1
days in row a1-???

Use the formula
=TEXT(($A$1&" "&A2&", "&$B$1)+0,"dddd")
in A3 and copy it accross. If need be, you can wrap an iserror statement around this to avoid errors in months with less than 31 days.

EDITED FORMULA -

you could use
=LEFT(TEXT(($A$1&" "&A2&", "&$B$1)+0,"ddd"),2)

for the two digit code you are looking for.

[ This Message was edited by: IML on 2002-05-04 06:49 ]
Thay's not what I mean.
I have in cell C3 : january 2002
I have in cell D7 : 1
Now those two elements give me 01.01.2002
IN want to know what 01.01.2002 is : TUESDAY
en so on untill the last day of the month.
Thank you in advance.
What is the result of:

=ISNUMBER(C3)


And, you state: Now those two elements give me 01.01.2002

You already have computed 01.01.2002 in some cell? If so, what is the result of:

=ISNUMBER(the-cell-that-contains-01.01.2002)



[ This Message was edited by: Aladin Akyurek on 2002-05-04 07:37 ]
I think you are misunderstand.
I have a row : cell A1 to A31 with entered the days of the month JANUARY 2002
In the row under this row I want the days of the week : MO TU WE TU FR SA SO
I hope,now you understand it.
Thansk for help
verluc is online now   Reply With Quote
Old May 4th, 2002, 09:50 AM   #7
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default


I think you are misunderstand.
I have a row : cell A1 to A31 with entered the days of the month JANUARY 2002
In the row under this row I want the days of the week : MO TU WE TU FR SA SO
I hope,now you understand it.
Thansk for help


Verluc,

You need to pick up some Excelese.

I have a row : cell A1 to A31 with entered the days of the month JANUARY 2002

is not a row: A1 to A31 is a range in column A.

Now, try to state precisely what you have in A1:

Is it JANUARY 2002? If so,

in B1 enter:

=ISNUMBER(A1)

What is the result?

And, in C1 enter:

=A1+0

What is the result?

Aladin
Aladin Akyurek is offline   Reply With Quote
Old May 5th, 2002, 08:59 AM   #8
IML
MrExcel MVP
 
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
Default

If the result of =isnumber(c3) is true, put
=IF(MONTH($C$3)=MONTH(DATE(YEAR($C$3),MONTH($C$3),D7)),LEFT(TEXT(DATE(YEAR($C$3),MONTH($C$3),D7),"ddd"),2),"")

next to your 1 and copy it 30 add'l rows or columns.

If it false, put
=IF(ISERR((LEFT($C$3,FIND(" ",$C$3)-1)&" "&D7&", "&RIGHT($C$3,LEN($C$3)-FIND(" ",$C$3)))+0),"",LEFT(TEXT((LEFT($C$3,FIND(" ",$C$3)-1)&" "&D7&", "&RIGHT($C$3,LEN($C$3)-FIND(" ",$C$3)))+0,"ddd"),2))

next to your 1 and copy it 30 add'l rows or columns.
IML is offline   Reply With Quote
Old May 6th, 2002, 08:26 AM   #9
g_erhard
New Member
 
Join Date: Mar 2002
Location: San Ramon CA
Posts: 23
Default

Given an Excel date, the Weekday function gives you a numeric result from 1 to 7, 1 being the first day of the week (you may have to set a flag of some sort if your week starts with Monday).

The Datevalue function will cook up an Excel date value, given a string that follows a Date format. I believe that it uses the Windows regional settings for dates, so if you're using MM/DD/YY (US) in Windows, Excel will interpret it properly. Likewise if Windows uses the DD/MM/YY format (Canada and Europe), Excel should also.

If you're using strings to describe your date "parts" (february, the year "two-thousand three" AD), I'd consider changing things to numbers and then using formatting to change the display...

B1 = 2 (month) date format = "MMMM"
B2 = 17 (day)
B3 = 1967 (year)

equation: Weekday(Datevalue(B1 & "/" & B2 & "/" & B3))

Results = 6 (date format "DDDD" = "Friday")
------------------
SO, to solve Verluc''s problem, all he really needs is the first date on the worksheet, and then add 1 to each cell going across. The dates will populate from one month to the next automatically. Then use the Month, Day, and Weekday functions to display details.


[ This Message was edited by: g_erhard on 2002-05-06 07:32 ]
g_erhard is offline   Reply With Quote
Old May 6th, 2002, 08:40 AM   #10
verluc
Board Regular
 
Join Date: Mar 2002
Posts: 1,289
Default

Quote:
On 2002-05-06 07:26, g_erhard wrote:
Given an Excel date, the Weekday function gives you a numeric result from 1 to 7, 1 being the first day of the week (you may have to set a flag of some sort if your week starts with Monday).

The Datevalue function will cook up an Excel date value, given a string that follows a Date format. I believe that it uses the Windows regional settings for dates, so if you're using MM/DD/YY (US) in Windows, Excel will interpret it properly. Likewise if Windows uses the DD/MM/YY format (Canada and Europe), Excel should also.

If you're using strings to describe your date "parts" (february, the year "two-thousand three" AD), I'd consider changing things to numbers and then using formatting to change the display...

B1 = 2 (month) date format = "MMMM"
B2 = 17 (day)
B3 = 1967 (year)

equation: Weekday(Datevalue(B1 & "/" & B2 & "/" & B3))

Results = 6 (date format "DDDD" = "Friday")
------------------
SO, to solve Verluc''s problem, all he really needs is the first date on the worksheet, and then add 1 to each cell going across. The dates will populate from one month to the next automatically. Then use the Month, Day, and Weekday functions to display details.


[ This Message was edited by: g_erhard on 2002-05-06 07:32 ]
Hi,
Can you give me more information how to insert this formule.
Many thanks
verluc is online now   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 03:33 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