I have the following requirement in my LibreOffice Calc spreadsheet:
ForEach Row 'r' in selected range, starting from the last row in the range, and moving backwards (up) one row at a time,
do some cell value comparisons, and based on that, either skip the row, or set some cell values, and delete the selected row, then proceed with the same process, with the row just above that.
ie.,
Representing CellValue(Column[A], Row[r])
as A[r]
,
And Representing the row before (just above) that,
as A[r-1]
,
I need to do the following:
FOR (r = LastRowInSelectedRange; r>1; r=r-1) {
IF FollowingConditionsAreTrue (
(r > 1)
AND (A[r] IsEqualTo A[r-1])
AND (B[r] IsEqualTo C[r-1])
AND (E[r] IsEqualTo E[r-1])
) ThenDoTheFollowing {
SET C[r-1] = C[r]
DeleteRow(r)
} EndIF
} EndFOR
Question: How can we implement this in LibreOffice Calc?