View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default If Formula with a cell that is a formula

On Wed, 23 Jan 2008 10:14:04 -0800, sconstance
wrote:

I'm trying to do a simple If function of If A1=A2 then return a 0 and if
incorrect return a 1.

However A1 is a NOW formula for the date and A2 is just the date manually
entered. It keeps returning a 1 because of the formula in A1 even when the
output of A1 matches A2.

Is there a way to get the If function to read the output value of A1 instead
of the formula inside of the cell?


The IF function IS reading the output value of A1. It is NOT reading the
formula.

The problem is that you don't understand what the NOW() function is doing.

From HELP for NOW: Returns the serial number of the current date and time.

It would be fortuitous if a manually entered date in A2 would match the date +
time in A1.

Some possible solutions:

1. In A1, use the TODAY function rather than the NOW function.

2. For your formula, use INT(A1) = A2


--ron