View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Date format in a text string

"Harlan Grove" wrote in message
ps.com...
"T. Valko" wrote...
...
That's because the TEXT function will only apply number formats.


A1 contains the text abc. B1 contains the formula

=TEXT(A1,"0;-0;\<0\;\-\-@\-\-")

and returns --abc--. At least running Excel 2003 SP1. Which version
are you running? [Surely you would have tested this.]


I did, but obviously it wasn't extensive enough.

I stand corrected!

As Rick noted, it works just as well without the slashes: (not extensively
tested)

=TEXT(A1,"0;-0;<0;--@--")

--
Biff
Microsoft Excel MVP