Compare rows of the same column of same DataTable

Hi,
I am comparing an Excel file row by row but i am having issues.
This is my conditions and excel file.export Clémentine2.xlsx (963.9 KB)
Also this is my project.Main.xaml (7.8 KB)

  • If the BA column (Alt Text) is different of the previous row for the first time from the previous one, then do nothing

  • If the BA column (Alt Text) is similar a second time to the previous one, then put the result of the AV row (Image Src) in the line in BC (Variant Metafield: Photo.Photo [string])

  • If the following row of the BA column (Alt Text) is still equal to the previous one, then put the result of AV row(Image Src) in the same line of the BG column (Variant Metafield: photo-2.photo-2 [string])

  • If the following row of the BA column (Alt Text) is still equal to the previous row in the same column, then put the result of AV row(Image Src) in the same line of the BH column Variant Metafield: photo-3.photo-3 [string]

@ppr @lakshman please help