• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Change the every time

hi
I have to change the formula in column D every time
How do I make the formula automatic?
thanks
 

Attachments

  • Date.xlsx
    42.1 KB · Views: 16
in column H, if it has a value that isn't 0, column D value in the same row takes the first date from column J.

Then skip two rows in column D and set the value of the current cell the same date.

Then you scan column H for the next value that isn't 0 and if you find the next non-zero value, you set column D of that row to the second date in column J.

Then skip two rows in column D and set the value of the current cell the same date.

and so on ...
 
Code:
= LET(
  k,    SEQUENCE(ROWS(Table1)),
  idx,  FILTER(k,Table1[Gift]<>0),
  date, XLOOKUP(k,idx,Date,0)+XLOOKUP(k-3,idx,Date,0),
  IF(date, date,""))
 

Attachments

  • Date (1).xlsx
    49.4 KB · Views: 7
@mamdouh
Sorry about that; I only saw, from another of your posts, that you use Office 2016. I have found that the thought and planning process is so different when using 365 to the full that I have deleted earlier versions from my computers.
 
Back
Top