DeepBlueIT
Technical User
I work away from home and am trying to create a spreadsheet which will automatically display the number of days spent away from home and the number of days spent at work.
Formula in C1 is =IF(A1>0,B1-A1+1,0)
Formula in D1 is =IF(A1>0,A2-B1-1,0)
Formula in C2 is =IF(A2>0,B2-A2+1,0) and so on
Columns C and D are Summed.
My problem is that I get strange negative figures in Columns C and D until dates are entered into Columns A and B
For example if I leave home on 01 January 2005 (A1) and arrive home on 10th January 2005 (B1) and then leave home again on 20th January 2005 (A2) then the tallies in C1 and D1 are correct but C2 displays -38371 and D2 displays -1 and of course the summed totals are also incorrect.
How do I get the spreadsheet not to display the negative (unwanted) figures and also to ignore these figures when summing the columns ?
I realise that the "errors" are generated because cells have no data entered in them but wondered if I could get round the problem ?
Thanks for the help
John
Formula in C1 is =IF(A1>0,B1-A1+1,0)
Formula in D1 is =IF(A1>0,A2-B1-1,0)
Formula in C2 is =IF(A2>0,B2-A2+1,0) and so on
Columns C and D are Summed.
My problem is that I get strange negative figures in Columns C and D until dates are entered into Columns A and B
For example if I leave home on 01 January 2005 (A1) and arrive home on 10th January 2005 (B1) and then leave home again on 20th January 2005 (A2) then the tallies in C1 and D1 are correct but C2 displays -38371 and D2 displays -1 and of course the summed totals are also incorrect.
How do I get the spreadsheet not to display the negative (unwanted) figures and also to ignore these figures when summing the columns ?
I realise that the "errors" are generated because cells have no data entered in them but wondered if I could get round the problem ?
Thanks for the help
John