L
leinad512
I notice that there are sometimes questions on here regarding
timestamping changes to cells and things like that. On a number of my
worksheets I solve these with iteration without using macros, yet I
rarely see this kind of answer given to people's questions. Is there
any reason why iterative formulas are bad?
Here are some examples (tested in excel 95 for the PC):
make sure that iteration is on in tools/options/calculation. For the
first two max iterations has to be at least 1, for the last it has to
be at least 2.
Timestamp a Cell:
User enters data in C1
Formula in B1: =IF(AND(C1<>B1,A1=NOW()),C1,B1)
Formula in A1: =IF(B1<>C1,NOW(),A1)
Format A1 as dd/mm/yy hh:mm:ss
A1 now displays the date and time that the data in c1 was last
changed.
Display Last Entry:
User enters data in C1
Formula in B1: =IF(AND(C1<>B1,A1=B1),C1,B1)
Formula in A1: =IF(B1<>C1,B1,A1)
A1 now displays whatever value was in C1 before it was last changed.
Count Changes:
User enters data in C1
Formula in B1: =IF(AND(C8<>B8,A8<>ROUND(A8,0)),C8,B8)
Formula in A1: =IF(B8<>C8,A8+0.6,ROUND(A8,0))
A1 starts at 0 and increments by 1 each time the value in c1 changes.
timestamping changes to cells and things like that. On a number of my
worksheets I solve these with iteration without using macros, yet I
rarely see this kind of answer given to people's questions. Is there
any reason why iterative formulas are bad?
Here are some examples (tested in excel 95 for the PC):
make sure that iteration is on in tools/options/calculation. For the
first two max iterations has to be at least 1, for the last it has to
be at least 2.
Timestamp a Cell:
User enters data in C1
Formula in B1: =IF(AND(C1<>B1,A1=NOW()),C1,B1)
Formula in A1: =IF(B1<>C1,NOW(),A1)
Format A1 as dd/mm/yy hh:mm:ss
A1 now displays the date and time that the data in c1 was last
changed.
Display Last Entry:
User enters data in C1
Formula in B1: =IF(AND(C1<>B1,A1=B1),C1,B1)
Formula in A1: =IF(B1<>C1,B1,A1)
A1 now displays whatever value was in C1 before it was last changed.
Count Changes:
User enters data in C1
Formula in B1: =IF(AND(C8<>B8,A8<>ROUND(A8,0)),C8,B8)
Formula in A1: =IF(B8<>C8,A8+0.6,ROUND(A8,0))
A1 starts at 0 and increments by 1 each time the value in c1 changes.