Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / May 2008

Tip: Looking for answers? Try searching our database.

& in formula changing date format to text ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 03 Apr 2008 18:28 GMT
I have this formula in a cell
=D12+1&" ->  " &D12+5
It produces this :   39528 ->  39532
The cell format in the cell shows as m/dd/yy
D12 = 3/20/08
I would like it to produce
3/21/08 -> 3/25/08

If I lose everyting in the cell except the D12+1, the result is the correct
date.
I believe the & is causing the format to change to the date#'s instead of
the date.

How can I get the cell to produce 3/21/08 -> 3/25/08 ?

Thanks,

Steve
PCLIVE - 03 Apr 2008 18:43 GMT
Since your cell can't be formatted as a date due to the additional data or
text that is being produced, then the output will be automatically displayed
as Text.  You could get your desired result with:

=MONTH(D12)&"/"&DAY(D12)+1&"/"&YEAR(D12)&" ->
"&MONTH(D12)&"/"&DAY(D12)+5&"/"&YEAR(D12)

HTH,
Paul

>I have this formula in a cell
> =D12+1&" ->  " &D12+5
[quoted text clipped - 15 lines]
>
> Steve
iashorty - 14 May 2008 20:31 GMT
Thanks Paul. I was able to use this formula to compare two fields brought in
with two different formattings.

> Since your cell can't be formatted as a date due to the additional data or
> text that is being produced, then the output will be automatically displayed
[quoted text clipped - 25 lines]
> >
> > Steve
T. Valko - 03 Apr 2008 18:46 GMT
>I believe the & is causing the format to change to the date#'s instead of
>the date.

You're concatenating TEXT into the formula so the result is a TEXT string
which ignores number formatting.

Try it like this:

=TEXT(D12+1,"m/dd/yy")&" -> "&TEXT(D12+5,"m/dd/yy")

Signature

Biff
Microsoft Excel MVP

>I have this formula in a cell
> =D12+1&" ->  " &D12+5
[quoted text clipped - 15 lines]
>
> Steve
Steve - 03 Apr 2008 18:58 GMT
Thanks guys. Both worked great.

Much appreciated,

Steve

> >I believe the & is causing the format to change to the date#'s instead of
> >the date.
[quoted text clipped - 25 lines]
> >
> > Steve
T. Valko - 03 Apr 2008 21:53 GMT
You're welcome!

Signature

Biff
Microsoft Excel MVP

> Thanks guys. Both worked great.
>
[quoted text clipped - 33 lines]
>> >
>> > Steve
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.