View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default possible to use IF to add formula?

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

On Aug 3, 2:26 am, John Smith wrote:
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?