Hello,

My dataset contains minute by minute stock market data for 200 companies AND if there was an announcement (eg release of results, changes of directors, etc) on that day for that stock, the row is flagged with 'TRUE' (and a 'FALSE' if there was no announcement on that day for that stock).

I would like to tag the day before the announcement for that stock with a '1' where the 'x' is denoted in the sample table below.

I would appreciate any thoughts as to how I could do this, please.
Stock Date (ddmmyyyy) Min of the day Announcement (true or false) Day before announcement flag
ABC 15022021 1 FALSE x
ABC 15022021 2 FALSE x
ABC 15022021 3 FALSE x
ABC 15022021 4 FALSE x
ABC 16022021 1 TRUE
ABC 16022021 2 TRUE
XYZ 17022021 1 FALSE x
XYZ 17022021 2 FALSE x
XYZ 17022021 3 FALSE x
XYZ 18022021 1 TRUE
Thank you so much

Regards
Imtiaz