View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Date-Mid Function

If you have G7 formatted as text (or started the entry with an apostrophe), then
your formula works ok.

But if G7 is a real number with a custom format to show that leading 0, then the
value in the cell is really just: 870526

And that screws up your =mid() pieces.



wrote:

I have this formula: =DATE(1900+MID(G7,1,3),MID(G7,4,2),MID(G7,6,2))
and the cell it is referencing has this in it: 0870526 (with the cell
format set as custom as '0000000'

The result it is producing is: 4/6/2774

It should be 5/26/1987.

Does anyone know what is going wrong?

-Anthony Morano
Pension Intern


--

Dave Peterson