Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Day of Week from dd/mm/yyyy

How do you find the Day of Week from a given date, "dd/mm/yyyy". I know it
is given by "dddd" but I need the reverse process. I would be open to the
numbers of the Day of Week too.

I am given the:
mm=11
dd=15
yyyy=2009

find
dddd or number of the Day of Week
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Day of Week from dd/mm/yyyy

On Sun, 30 May 2010 14:26:01 -0700, sort
wrote:

How do you find the Day of Week from a given date, "dd/mm/yyyy". I know it
is given by "dddd" but I need the reverse process. I would be open to the
numbers of the Day of Week too.

I am given the:
mm=11
dd=15
yyyy=2009

find
dddd or number of the Day of Week


The formula
=WEEKDAY(DATE(2009,11,15),2)
returns the value 7, indicating that November 15, 2009 was a Sunday.

Hope this helps / Lars-Åke

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Day of Week from dd/mm/yyyy

"Lars-Åke Aspelin" schrieb im Newsbeitrag
...
On Sun, 30 May 2010 14:26:01 -0700, sort
wrote:

How do you find the Day of Week from a given date, "dd/mm/yyyy". I know it
is given by "dddd" but I need the reverse process. I would be open to the
numbers of the Day of Week too.

I am given the:
mm=11
dd=15
yyyy=2009

find
dddd or number of the Day of Week


The formula
=WEEKDAY(DATE(2009,11,15),2)
returns the value 7, indicating that November 15, 2009 was a Sunday.

Hope this helps / Lars-Åke



Or in VBA:
Dim mm as Integer, dd as Integer, yyyy as Integer, dddd as string
mm=11
dd=15
yyyy=2009
dddd = Format(DateSerial(yyyy, mm, dd), "dddd")

Helmut.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Day of Week from dd/mm/yyyy

Additional options to the previous answer.

The following returns the day of the week for any date. (I have used today's
date in each of the examples)

On a worksheet:
=TEXT(TODAY(),"ddd")
or
=TEXT(TODAY(),"dddd")

In VBA
Dim DayOfWeek As String

DayOfWeek = Format(Date, "ddd")
MsgBox DayOfWeek

DayOfWeek = Format(Date, "dddd")
MsgBox DayOfWeek

--
Regards,

OssieMac


"sort" wrote:

How do you find the Day of Week from a given date, "dd/mm/yyyy". I know it
is given by "dddd" but I need the reverse process. I would be open to the
numbers of the Day of Week too.

I am given the:
mm=11
dd=15
yyyy=2009

find
dddd or number of the Day of Week

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Day of Week from dd/mm/yyyy

=WEEKDAY(DATE(2009,11,15),2) would be perfect but I am looking for something
to put in a VBA program not in a cell.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Day of Week from dd/mm/yyyy

Did you read Ossie's post?



"sort" wrote in message
...
=WEEKDAY(DATE(2009,11,15),2) would be perfect but I am looking for
something
to put in a VBA program not in a cell.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Day of Week from dd/mm/yyyy

hi
if your given date is in A1, try this to put the weekday name in b1......
Sub xlcalcit()
Dim s As String
Dim d As String
s = [A1].Value
d = WeekdayName(Weekday(s))
[B1].Value = d
End Sub

"sort" wrote:

How do you find the Day of Week from a given date, "dd/mm/yyyy". I know it
is given by "dddd" but I need the reverse process. I would be open to the
numbers of the Day of Week too.

I am given the:
mm=11
dd=15
yyyy=2009

find
dddd or number of the Day of Week

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Day of Week from dd/mm/yyyy

afterthought
the code i posted will work on any date, past, current or future.

regards
FSt1

"FSt1" wrote:

hi
if your given date is in A1, try this to put the weekday name in b1......
Sub xlcalcit()
Dim s As String
Dim d As String
s = [A1].Value
d = WeekdayName(Weekday(s))
[B1].Value = d
End Sub

"sort" wrote:

How do you find the Day of Week from a given date, "dd/mm/yyyy". I know it
is given by "dddd" but I need the reverse process. I would be open to the
numbers of the Day of Week too.

I am given the:
mm=11
dd=15
yyyy=2009

find
dddd or number of the Day of Week

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change date format from dd/mm/yyyy to mm/yyyy flow23 Excel Discussion (Misc queries) 3 April 4th 23 11:26 AM
Formula bar shows mm/dd/yyyy. To show dd/mm/yyyy. How? magna Excel Discussion (Misc queries) 2 January 1st 08 08:14 AM
how do I change date from mm/dd/yyyy to dd:mm:yyyy format in Excel Jack Wilson New Users to Excel 4 July 18th 06 01:57 PM
change birthday display from mm/dd/yyyy to HIDE the yyyy? johnp Excel Worksheet Functions 1 May 9th 06 09:56 PM
opening excel file - date format problem: DD/MM/YYYY vs MM/DD/YYYY yung Excel Programming 2 March 18th 05 12:50 PM


All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"