Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Motaad,
I only get a 0 when E2 holds a text representation of a 7. Test E2 witht he formula =ISTEXT(E2) If it is text reformat the cell as General and re-enter the 7 -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings with @tiscali.co.uk "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 |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Are you sure the value in E2 is a number and not text.
Enter this in a cell =ISNUMBER(E2) do you get TRUE or FALSE? Gord Dibben MS Excel MVP On Fri, 9 Mar 2007 15:04:03 -0800, Motaad wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CELLS NOT CALC FORMULAS - VALUES STAY SME FORMULAS CORRECT?? HELP | Excel Worksheet Functions | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
If Statements | Excel Discussion (Misc queries) | |||
How to Sum with two if statements | Excel Worksheet Functions | |||
If statements | Excel Worksheet Functions |