//flex table opened by JP

Click to See Complete Forum and Search --> : Excel: day of week in text & day of month?


Woodcycl
02-21-2008, 02:00 PM
What syntax would I use to obtain a view of a date field where it would show the text day of the week and then the day of the month?

For example, today is Thursday, February 21, 2008. I want the field to show: Thu 21

What syntax will result in Thu 21?

Thanks,
Brian

Shoreguy
02-21-2008, 02:27 PM
It will be easier for you to right-click a cell and select "format cell", or hit the fx radio button to initiate the function wizard. That being said...here's from 'fx help'

WEEKDAY

See Also

Returns the day of the week corresponding to a date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default.

Syntax

WEEKDAY(serial_number,return_type)

Serial_number is a sequential number that represents the date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.

Return_type is a number that determines the type of return value.

Return_type Number returned
1 or omitted Numbers 1 (Sunday) through 7 (Saturday). Behaves like previous versions of Microsoft Excel.
2 Numbers 1 (Monday) through 7 (Sunday).
3 Numbers 0 (Monday) through 6 (Sunday).

Remark
Microsoft Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900. Microsoft Excel for the Macintosh uses a different date system as its default.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How?

Create a blank workbook or worksheet.
Select the example in the Help topic. Do not select the row or column headers.


Selecting an example from Help

Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Tools menu, point to Formula Auditing, and then click Formula Auditing Mode.

1
2
A
Data
2/14/2008
Formula Description (Result)
=WEEKDAY(A2) Day of the week, with numbers 1 (Sunday) through 7 (Saturday) (5)
=WEEKDAY(A2,2) Day of the week, with numbers 1 (Monday) through 7 (Sunday) (4)
=WEEKDAY(A2,3) Day of the week, with numbers 0 (Monday) through 6 (Sunday) (3)


Note 2/14/2008 is a Thursday.

DAY

See Also

Returns the day of a date, represented by a serial number. The day is given as an integer ranging from 1 to 31.

Syntax

DAY(serial_number)

Serial_number is the date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.

Remarks

Microsoft Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900. Microsoft Excel for the Macintosh uses a different date system as its default.

Values returned by the YEAR, MONTH and DAY functions will be Gregorian values regardless of the display format for the supplied date value. For example, if the display format of the supplied date is Hijri, the returned values for the YEAR, MONTH and DAY functions will be values associated with the equivalent Gregorian date.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How?

Create a blank workbook or worksheet.
Select the example in the Help topic. Do not select the row or column headers.


Selecting an example from Help

Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Tools menu, point to Formula Auditing, and then click Formula Auditing Mode.

1
2
A
Date
15-Apr-2008
Formula Description (Result)
=DAY(A2) Day of the date above (15)

Midknyte
02-21-2008, 02:29 PM
you would need to use the TEXT function

Let's say that A2 is the date you want. in another cell you'd type:
=TEXT(A2,"ddd d")

ddd = short day name
dddd = full day name

d = date day number

If it's just for today's date, you can embed the today function.

=TEXT(TODAY(),"ddd d")

You didn't really say how or why you need it that way, so I'm just guessing.

Woodcycl
02-21-2008, 03:46 PM
Thanks Midknyte - that worked perfectly.