View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Finding dates without attention to data formats

On Wed, 16 May 2012 15:13:26 +0100, Walter Briscoe wrote:

I am using Microsoft Office Excel 2003 (11.8346.8341) SP3.
I have a sheet which represents a calendar.

The following should help give a picture of that calendar:

B ... DK DL
1 12
2 May
...
16 Tue 15 Data for 15/05/12
17 Wed 16 Data for 16/05/12
18 Thu 17 Data for 17/05/12

There are formulas (sic - I prefer formulae) and data formats involved
DK17 is =DK16+1 and has a format of dd and so appears as 16, but
actually represents 16/05/2012 (or 05/16/2012 in American).

I want to search for a date with the "Find and Replace" dialog.
e.g. I want to find that 16, by searching for 16/05/2012 or 05/16/2012.
I can do so, if I change the format to dd/mm/yyyy.
Searching Values seems to search for the rendering of the cell.
Searching formulas seems to search formulas. e.g. I can search for DK16.

I suspect I can't search for either 16/05/2012 or 05/16/2012 and match
that 16 which displays on the screen.

However, it seems worth asking the question.
I had been looking for the meaning of Formulas in the "Find and Replace"
dialog, without success. I now understand it.

So, "Look in" has logic
Formulas Search Formulas
Values Search Values as displayed with data formats.
Comments I assume this searches Comments attached to cells.

I want to be able to search for
TrueValues Search Values without attention to data formats.

I hope I have explained my need and would appreciate light on it. ;)


The following applies to Excel 2007, but I don't believe there have been changes in this feature since 2003.

Why do you need to search by formulas? Why not just search by Values, if what you are looking for is a "16" being displayed in the cell. If I search by values, and have a "16" visible in the cell, Excel will FIND it no matter if that 16 is the result of a formula, or just a date.

In your examples above, where the format is dd, again, Excel, with a search by Values, will Find the 16. No need to change the format.
Of course, if you format the cells as General, then the display might be 41045 and searching for 16 will not return anything.

If the above suggestions do not help, then, backing up: why do you want to do the search? Perhaps there is another way of solving your real problem.