Thread: IF STATEMENT
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary Brown[_4_] Gary Brown[_4_] is offline
external usenet poster
 
Posts: 209
Default IF STATEMENT

Charlie,
You lost the Month( ) function AND testing if different years from
previous posts.
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"charlie" wrote:

OK, I did that, but if the cell is blank it's still returning a 5, but I want
it to return a zero.

"Fred Smith" wrote:

You want the AND function, as in:
=IF(and(b170,B17=B2),1,MONTH($B$2)-MONTH(B17))

You don't need Sum if you're only doing arithmetic.

Regards,
Fred

"charlie" wrote in message
...
I need a formula that looks at a cell and if it's not empty it preforms the
following function:
=IF(B17=B2,1,SUM(MONTH($B$2)-MONTH(B17))

B2 is set for 6/1/08, so right now if the cell is blank it returns a 5,
but
I only want it to do the calculation if there's a date in the cell. How
can
I add another IF statement to this to say IF(B170) then look at the above
function???