possible to use IF to add formula?

J

John Smith

I would like to compare every two consecutive cells in a column
and either fill in 0 or a formula, something like this:

if (day(c2) = day(c1),fill in the formula "=r[-1]c + 1", else fill
in zero)--------this sould operate on D1 then copy & paste all the
way to d1225.

Can this be done?
 
P

Pete_UK

You won't be able to do this in D1, as you can't refer to the row
above, so put this formula in D2:

=IF(DAY(C2)=DAY(C1),C1+1,0)

Then select D2 again and copy the formula down by double-clicking the
fill handle (the small black square in the bottom right corner of the
cursor.

Hope this helps.

Pete
 
Top