Day part of date

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

In B2 I have 27/11/08
In A2 I am trying to extract the day as ddd (Thu in this case)

If I use =Day(B2) in A2 with the cell formatted as ddd I get Fri.
I tested in another cell with =B2 formatted as ddd - dd mmm yyyy and I
correctly get Thu - 27 Nov 2008. Why does the cell A2 result fail, and is
there an easy way to do this?

Sandy
 
Since you've already formatted A2 to "ddd", use
=B2
as the formula in A2.
--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

In B2 I have 27/11/08
In A2 I am trying to extract the day as ddd (Thu in this case)

If I use =Day(B2) in A2 with the cell formatted as ddd I get Fri.
I tested in another cell with =B2 formatted as ddd - dd mmm yyyy and I
correctly get Thu - 27 Nov 2008. Why does the cell A2 result fail, and is
there an easy way to do this?

Sandy
 
RD
Certainly did the trick. Don't understand why =Day(B2) didn't work though.
Many thanks.
Sandy
 
FWIW, in case you're interested in why Fri was returned,
if you read the Help file for the Day() function,
you'll see that the function expects a serial number as it's only argument.

If you format A2 to General, your formula:
=Day(B2)
returns 27.

To the Day() function, that means - the 27th day starting at 1/1/1900,
which was a Friday.
--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

RD
Certainly did the trick. Don't understand why =Day(B2) didn't work though.
Many thanks.
Sandy
 
RD
Thank you - well explained!
Sandy

RagDyeR said:
FWIW, in case you're interested in why Fri was returned,
if you read the Help file for the Day() function,
you'll see that the function expects a serial number as it's only
argument.

If you format A2 to General, your formula:
=Day(B2)
returns 27.

To the Day() function, that means - the 27th day starting at 1/1/1900,
which was a Friday.
--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

RD
Certainly did the trick. Don't understand why =Day(B2) didn't work though.
Many thanks.
Sandy
 
Back
Top