View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default if statements and formulas

e7 is probably text so
="7" or
=if(value(e2)=7,h2-f2,0)

--
Don Guillett
SalesAid Software

"Motaad" wrote in message
...
I am trying to write an "if" statement such as
if a column cell equals the number 7 substract the date in one column from
a
date in another column

=if(e2=7,h2-f2,0) - h2 being a date column and f2 being a date column

Unfortunately it always gives me a zero even if there is a 7 in column e2.
--
Motaad