[Solved] Increment Columns

Discuss the spreadsheet application
Locked
BAC94
Posts: 6
Joined: Thu Mar 16, 2017 12:34 am
Location: Massachusetts

[Solved] Increment Columns

Post by BAC94 »

I have a single column in one sheet that pulls from several columns of another sheet. Each row of the first sheet sums up the column of the third sheet. So I have, for example (Sheet1, Row1, Column1):
=SUM(Sheet3.A1:A30)

But as I go down the column of Sheet1, I want the columns to increment:
=SUM(Sheet3.B1:B30)
=SUM(Sheet3.C1:C30)

But all the different types of fills I've tried increment the row numbers:
=SUM(Sheet3.A2:A31)
=SUM(Sheet3.A3:A32)
etc.

Is there a way to increment column indices?
Last edited by BAC94 on Tue Dec 19, 2017 3:45 am, edited 1 time in total.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Increment Columns

Post by acknak »

I don't think this is possible using just the drag-fill, which will always follow the drag direction.

You can do it in two steps (I think).
1) Enter the first formula: =SUM(Sheet3.A1:A30)
2) Drag-fill across to get the other column formulas
3) Select the formulas and convert to absolute references (Shift+F4)
4) Copy the formula cells to the clipboard
5) Edit > Paste Special, Options: Transpose: ON, OK

That should give you the formulas you want, summing the columns while displaying in rows.

The alternative would be to use a formula to choose the ranges to sum, something like: =SUM(OFFSET($Sheet3.$A$1;0;0;30;1))
AOO4/LO5 • Linux • Fedora 23
BAC94
Posts: 6
Joined: Thu Mar 16, 2017 12:34 am
Location: Massachusetts

Re: [Solved] Increment Columns

Post by BAC94 »

Thank you. The first suggestion worked. It was a little finicky, but I got the hang of it.
OpenOffice 4.1.3
wingguy
Posts: 3
Joined: Thu Mar 11, 2021 9:34 pm

Re: [Solved] Increment Columns

Post by wingguy »

I had a spreadsheet the data was entered by rows, vertically, about 150 rows.
I wanted to drag down and increment now only the row number but the column letter also.
The row would increment, but the column letter stayed the same.
Finally fixed this by placing appropiate column letters in a column ( A,B,C,D.... etc ) vertically, way to the side,
out of the way, to correspond to the letter needed in the formula.
Then in the row formula use INDIRECT to fetch the column letter, and the row number increments anyway.
Works like a charm and saved me alot of typing.
Thought I'd pass this on.
Open Office 4.1.9 on windows 10
User avatar
karolus
Volunteer
Posts: 1243
Joined: Sat Jul 02, 2011 9:47 am

Re: [Solved] Increment Columns

Post by karolus »

wingguy wrote: Wed Feb 05, 2025 4:44 pm I had a spreadsheet the data was entered by rows, vertically, about 150 rows.
I wanted to drag down and increment now only the row number but the column letter also.

Code: Select all

=INDEX($A$1:$AZ$150;ROW(A1);ROW(A1))
pull down!
…now only the row number but the column letter also
??
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: [Solved] Increment Columns

Post by Alex1 »

Enter =SUM(OFFSET(Sheet3.A$1;0;ROW()-1;30)) in Sheet1.A1, then fill down.
AOO 4.1.16 & LO 25.8.3 on Windows 10
Locked