Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Formatting date as first letter of day only

In various cells I have dates written in as dd/mm/yy format.

I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).

How can I do this please
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Formatting date as first letter of day only

If you can do with two lettes, it is no problem.

Format Custom Type: ddd

Regards,
Per

On 16 Dec., 07:42, GavinS wrote:
In various cells I have dates written in as dd/mm/yy format.

I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).

How can I do this please


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default Formatting date as first letter of day only

If you did this, how would you distinguish between Tuesday/Thursday,
or between Saturday/Sunday?

Pete

On Dec 16, 6:42*am, GavinS wrote:
In various cells I have dates written in as dd/mm/yy format.

I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).

How can I do this please


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Formatting date as first letter of day only

On Dec 16, 8:28*pm, Pete_UK wrote:
If you did this, how would you distinguish between Tuesday/Thursday,
or between Saturday/Sunday?

Pete

On Dec 16, 6:42*am, GavinS wrote:

In various cells I have dates written in as dd/mm/yy format.


I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).


How can I do this please


No I cannot use 2 letters.
Distinguishing between Tues and Thursday - Tuesday comes after
Monday ;-)
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Formatting date as first letter of day only

Maybe you can use a helper cell with a formula:

=left(text(a1,"ddd"),1)

(And hide the original column???)

On 12/16/2010 00:42, GavinS wrote:
In various cells I have dates written in as dd/mm/yy format.

I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).

How can I do this please


--
Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Formatting date as first letter of day only

On Dec 16, 6:20*am, Dave Peterson wrote:
Maybe you can use a helper cell with a formula:

=left(text(a1,"ddd"),1)

(And hide the original column???)

On 12/16/2010 00:42, GavinS wrote:

In various cells I have dates written in as dd/mm/yy format.


I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).


How can I do this please


--
Dave Peterson


If you no longer need the date for calculation you could just type in
T or W or you could have a macro do it all for you. Now, if you DO
need for future calculation a macro or formula looking for the T after
M for Tuesday. However, you would no longer be able to use the actual
date....
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Formatting date as first letter of day only

Hi Gavin,

You can create your own User Defined Function.
Eg:

Public Function FirstOfWeekday(aDate As Date) As String

Dim iWeekday As Integer

iWeekday = Weekday(aDate, vbSunday)

FirstOfWeekday = Choose(iWeekday, "S", "M", "T", "W", "T", "F",
"S")

End Function

On your sheet you enter the formula =FirstOfWeekday(Now()).


HTH,

Wouter
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Formatting date as first letter of day only

Thanks for all your responses. Regretfully the solution is way too
complicated. TO explain.

I have a time sheet - user enters in the first day of the month.
Another cell points to this first day and interprets this date as a
day - which I can just format as ddd - but it takes up too much space.
To teh right of this cell is the remaining days of the month -
formatted as ddd.

So Wouter's suggestion is the best but not dynamic enough - because
the 1st of every month never falls on the same day.



On Dec 17, 5:20*am, Wouter HM wrote:
Hi Gavin,

You can create your own User Defined Function.
Eg:

Public Function FirstOfWeekday(aDate As Date) As String

* * Dim iWeekday As Integer

* * iWeekday = Weekday(aDate, vbSunday)

* * FirstOfWeekday = Choose(iWeekday, "S", "M", "T", "W", "T", "F",
"S")

End Function

On your sheet you enter the formula =FirstOfWeekday(Now()).

HTH,

Wouter


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Formatting date as first letter of day only


Simple.


format as date and show only day of week. Then:

If('mycell'=Monday,"M")

And string seven IF statements together there to convert the full
printed day of week out as only a single letter.

For a workbook with a date field that comes close see these:

http://office.microsoft.com/en-us/templates/CT010117277.aspx#ai:TC030008309|

or

http://tinyurl.com/25kboja
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default Formatting date as first letter of day only

Wouter's UDF will be copied to a general module in your workbook.

First of month date in A1 or.........your choice.

In "Another cell" enter =FirstOfWeekDay(A1)


Gord Dibben MS Excel MVP



On Thu, 16 Dec 2010 15:25:16 -0800 (PST), GavinS
wrote:

Thanks for all your responses. Regretfully the solution is way too
complicated. TO explain.

I have a time sheet - user enters in the first day of the month.
Another cell points to this first day and interprets this date as a
day - which I can just format as ddd - but it takes up too much space.
To teh right of this cell is the remaining days of the month -
formatted as ddd.

So Wouter's suggestion is the best but not dynamic enough - because
the 1st of every month never falls on the same day.



On Dec 17, 5:20*am, Wouter HM wrote:
Hi Gavin,

You can create your own User Defined Function.
Eg:

Public Function FirstOfWeekday(aDate As Date) As String

* * Dim iWeekday As Integer

* * iWeekday = Weekday(aDate, vbSunday)

* * FirstOfWeekday = Choose(iWeekday, "S", "M", "T", "W", "T", "F",
"S")

End Function

On your sheet you enter the formula =FirstOfWeekday(Now()).

HTH,

Wouter



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Formatting date as first letter of day only

You could use:
=MID("SMTWTFS",WEEKDAY(A1),1) 'A1 is the cell with the date in it
Or if you want a unique letter for each day of the week you could use the
2nd letter Thursday & Saturday
=MID("SMTWHFA",WEEKDAY(A1),1)
or whatever scheme you wish.

On Wed, 15 Dec 2010 22:42:22 -0800 (PST), GavinS
wrote:

In various cells I have dates written in as dd/mm/yy format.

I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).

How can I do this please


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Formatting date as first letter of day only

On Dec 18, 3:24*am, wrote:
You could use:
* * * * =MID("SMTWTFS",WEEKDAY(A1),1) * 'A1 is the cell with the date in it
Or if you want a unique letter for each day of the week you could use the
2nd letter Thursday & Saturday
* * * * =MID("SMTWHFA",WEEKDAY(A1),1)
or whatever scheme you wish.

On Wed, 15 Dec 2010 22:42:22 -0800 (PST), GavinS
wrote:

In various cells I have dates written in as dd/mm/yy format.


I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).


How can I do this please


Thanks, I think this is the simplest although is the WEEKDAY function
only included in an addin? I will find out.
Thanks for the help
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default Formatting date as first letter of day only

On Fri, 17 Dec 2010 17:31:05 -0800 (PST), GavinS
wrote:

On Dec 18, 3:24*am, wrote:
You could use:
* * * * =MID("SMTWTFS",WEEKDAY(A1),1) * 'A1 is the cell with the date in it
Or if you want a unique letter for each day of the week you could use the
2nd letter Thursday & Saturday
* * * * =MID("SMTWHFA",WEEKDAY(A1),1)
or whatever scheme you wish.

On Wed, 15 Dec 2010 22:42:22 -0800 (PST), GavinS
wrote:

In various cells I have dates written in as dd/mm/yy format.


I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).


How can I do this please


Thanks, I think this is the simplest although is the WEEKDAY function
only included in an addin? I will find out.
Thanks for the help



Try this:

It is using no special functions

http://www.mediafire.com/?ykh9nurz3zu9eeo

  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Formatting date as first letter of day only

On Dec 19, 5:13*am, CellShocked
<cellshoc...@thecellvalueattheendofthespreadsheet. org wrote:
On Fri, 17 Dec 2010 17:31:05 -0800 (PST), GavinS



wrote:
On Dec 18, 3:24 am, wrote:
You could use:
=MID("SMTWTFS",WEEKDAY(A1),1) 'A1 is the cell with the date in it
Or if you want a unique letter for each day of the week you could use the
2nd letter Thursday & Saturday
=MID("SMTWHFA",WEEKDAY(A1),1)
or whatever scheme you wish.


On Wed, 15 Dec 2010 22:42:22 -0800 (PST), GavinS
wrote:


In various cells I have dates written in as dd/mm/yy format.


I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).


How can I do this please


Thanks, I think this is the simplest although is the WEEKDAY function
only included in an addin? I will find out.
Thanks for the help


* Try this:

* It is using no special functions

http://www.mediafire.com/?ykh9nurz3zu9eeo


Thanks - another great and reasonably simple solution.
My challenge is that I live in a 3rd world country and all solutions
must be simple and be able to possibly understood by others whose
knowledge of excel (and english for that matter ) is limited
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Formatting date as first letter of day only

On Sat, 18 Dec 2010 18:26:11 -0800 (PST), GavinS
wrote:

On Dec 19, 5:13*am, CellShocked
<cellshoc...@thecellvalueattheendofthespreadsheet .org wrote:
On Fri, 17 Dec 2010 17:31:05 -0800 (PST), GavinS



wrote:
On Dec 18, 3:24 am, wrote:
You could use:
=MID("SMTWTFS",WEEKDAY(A1),1) 'A1 is the cell with the date in it
Or if you want a unique letter for each day of the week you could use the
2nd letter Thursday & Saturday
=MID("SMTWHFA",WEEKDAY(A1),1)
or whatever scheme you wish.


On Wed, 15 Dec 2010 22:42:22 -0800 (PST), GavinS
wrote:


In various cells I have dates written in as dd/mm/yy format.


I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).


How can I do this please


Thanks, I think this is the simplest although is the WEEKDAY function
only included in an addin? I will find out.
Thanks for the help


* Try this:

* It is using no special functions

http://www.mediafire.com/?ykh9nurz3zu9eeo


Thanks - another great and reasonably simple solution.
My challenge is that I live in a 3rd world country and all solutions
must be simple and be able to possibly understood by others whose
knowledge of excel (and english for that matter ) is limited


Which is why most if not all of my sheets are macro free, whenever
possible.

Also, Microsoft user submitted templates must be, as a rule.

I have a blood pressure workbook that has the macro text included for
user installation merely for hiding leap year data in the chart sheets
without jumping though hoops between charts and data. It is among my
other sheets on that site. My macros do not extend much farther than
that. It was recorded.


OOOps... my MS posted stuff, that is...

http://office.microsoft.com/en-us/ma...0000658&ats=tc


  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formatting date as first letter of day only

On Friday, December 17, 2010 at 11:24:17 AM UTC-5, wrote:
You could use:
=MID("SMTWTFS",WEEKDAY(A1),1) 'A1 is the cell with the date in it
Or if you want a unique letter for each day of the week you could use the
2nd letter Thursday & Saturday
=MID("SMTWHFA",WEEKDAY(A1),1)
or whatever scheme you wish.

On Wed, 15 Dec 2010 22:42:22 -0800 (PST), GavinS
wrote:

In various cells I have dates written in as dd/mm/yy format.

I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).

How can I do this please


AWESOME!!! Worked perfectly...been searching multiple posts and this one finally worked and so easily. One small change I made was substituting N for Sunday and R for Thursday in the "SMTWTFS" text string...now =MID("NMTWRFS",WEEKDAY(A1),1)...again, thanks a ton!
  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formatting date as first letter of day only

On Thursday, December 16, 2010 11:42:22 AM UTC+5, GavinS wrote:
In various cells I have dates written in as dd/mm/yy format.

I would like to format this as d - that is the first of the day only.
For example 16/12/10 displayed as T (for Thursday).

How can I do this please


USE THIS CODE:

string stTodayDayFirstLetter = DateTime.Now.ToString("ddd").Substring(0, 1);
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
DATE() Month in Letter NOT Number Neon520 Excel Worksheet Functions 23 January 15th 08 07:41 PM
date in Excel displays incorrectly when merged in letter Feather 52 Excel Discussion (Misc queries) 1 March 13th 06 10:36 PM
Number zero and the Letter O formatting [email protected] Excel Programming 2 March 16th 05 11:24 AM
press letter and go 2 entry begin w letter in data validation drop MCP Excel Programming 1 August 28th 04 05:07 PM
Find out from a date if it is a red letter day or not Abdul Salam Excel Programming 0 July 16th 03 11:19 AM


All times are GMT +1. The time now is 07:36 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"