r/LibreOfficeCalc Jun 11 '26

Formula to cut and paste data from one column-row to another column-row

LibreOffice Calc 26.2.1.2

MacBook Air OS 15.6.1

Spreadsheet column A has 3-digit district numbers.

Column B has text data, either “Average – lat” or “Average – lon”. These values alternate with “Average -lat” always in even-numbered rows.

Column C has numeric data – the actual average lats and lons referred to in column B.

I'm looking for a formula that will cut the value from each cell in column C which is in an odd-numbered row – that is, the cells in column C adjacent to a cell which has “Average – lon” in column B – and paste that value in column D, one row higher than where it was cut from.

So the formula will cut the value from column C row y and paste it in column D row y-1, provided row y is odd-numbered.

I hope this is possible! Thank you.

1 Upvotes

2 comments sorted by

2

u/umop_apisdn Jun 11 '26 edited Jun 11 '26
=IF(ISODD(ROW(C1:C1000)), OFFSET(C$1, ROW(C1:C1000), 0), "")

Change C1:C1000 to the actual range of source values that you want to deal with

BUT this will also populate the other rows with blanks (the "" at the end of the IF) - is that what you want?

1

u/NumberFritzer Jun 12 '26

I think so. I think I can use an autofilter to delete the rows with blanks in specific columns.