Dave Peterson Answer

O

Oldjay

Dave gave me this correct answer of

=if(weekday(a1)=1,text(a1,"dddd"),"Wrong Date")

to my question of how to be sure an input date was on a Sunday

Where do all you experts find these answers?

Are they written down somewhere?

What does "dddd" mean?
 
B

Bernie Deitrick

And the "dddd" is a formatting string, one that tells the Excel function TEXT to format the value in
A1 as a named date. For example, with today's date 10/24/06 in cell A1


=TEXT(A1,"0") returns 39014
=TEXT(A1,"d") returns 24
=TEXT(A1,"dd") returns 24
=TEXT(A1,"ddd") returns Tue
=TEXT(A1,"dddd") returns Tuesday
=TEXT(A1,"m") returns 10
=TEXT(A1,"mmm") returns Oct
=TEXT(A1,"mmmm") returns October
=TEXT(A1,"mmm dd, yyyy") returns Oct 24, 2006

HTH,
Bernie
MS Excel MVP
 
D

Dave Peterson

Also, if you look at Excel's help for: Number format codes

You'll find a lot of information for times/dates/and just regular old numbers.
 
O

Oldjay

Thanks I have been looking in VBA help

Dave Peterson said:
Also, if you look at Excel's help for: Number format codes

You'll find a lot of information for times/dates/and just regular old numbers.
 
T

Tushar Mehta

I don't know who gets the credit for the adage "genius is 99% hard work
and 1% inspiration" but it sure feels true.

Without necessary claiming the mantle of genius, I find 99% of the time
I find solutions through hard work -- the help file, google, the msdn
archives, asking seemingly dumb questions of myself and of others, and
lots and lots of trials-with-many-an-error.

Once in a while I do have an inspiration. "Gee, I wonder what would
happen if I combined this with that?" Or "conceptually, if I can do
this, I should be able to do that." Or, out of the clear blue sky,
"Gee, I wonder if I can do this?"

And, on more than one occasion, it has been sheer desperation. "Nothing
I've tried has worked. Let me try this seemingly absurd -- absolutely
absurd -- idea. And, this variation, and that variation, and..."

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2007
 
Top