Google Sheets: When copying formula into the next row, it selects the next column as the reference

p_s

New Member
Joined
Sep 23, 2020
Messages
30
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
  3. Web
Hi,

Is there a way for you to have the formula reference the next column instead of the next row when you copy down a row? For example: consider cells in the last column. Assume you copy and paste the formula in E1 into E2 & E3.

For examples
ChancesWin TotalAmountNumber of triesSUM(A2:A6)
345123129Number of WinsSUM(B2:B6)
423234234Total AmountSUM(C2:C6)
543523525254566
632425252412
72342522242
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
In excel you could use something like
Excel Formula:
=SUM(INDEX($A$2:$C$6,0,ROWS($E$1:$E1)))
which should also work in google sheets.
 
Upvote 0
Hi Jason

Thanks for your help:

What if the formula is more complicated? I tried this on my sheet, it wasn't for a sum, but I figured the concept would be the same, but it just gave blanks. Chances are high that I didn't understand the theory correctly.

Cell ref (B55): PersonCell Ref (G55)
List of Items
(B56) #1(G56) =iferror(if($B56="","",join(", ",FILTER($F$10:$F$51&" "&$B$10:$B$51,$F$10:$F$51>0))))
(B57) #2(G57) =iferror(if($B57="","",join(", ",FILTER($G$10:$G$51&" "&$B$10:$B$51,$G$10:$G$51>0))))
(B58) #3(G58) =iferror(if($B58="","",join(", ",FILTER($H$10:$H$51&" "&$B$10:$B$51,$H$10:$H$51>0))))

What if there are merged cells/gaps between formulae? This worked for C1, but when I tried to expand it, the $C1:$1, changed to $C1:8 and if I changed it back to $C1:$1 and the A8 from Row($A$3:$A8) to A4, it would return the same value or a completely different value from what it should have. But also having to change each formula just makes it more complicated, I might as well have copy pasted the formula it already has and then edited it.

Example:
First NameJaneJohnFName
Last NameDoeDoeLName
"=Worksheet!C1"Main
Criteria 1
Criteria 2
Criteria 3
Criteria 4
Criteria 5
Criteria 6
"=Worksheet!D1"Main
C1
C2
C3
C4
C5
C6
"=Worksheet!E1"Main
C1
C2
C3
C4
C5
C6
 
Upvote 0
If C1:C7 is merged then it is still counted as 7 rows by the formula. You can use COUNTA instead of ROWS which will only see each merged range as a single item.
From the formulas that you show, best guess would be

=iferror(if($B56="","",join(", ",FILTER(INDEX($F$10:$F=H$51,0,COUNTA($C$1:$C1))&" "&$B$10:$B$51,INDEX($F$10:$F=H$51,0,COUNTA($C$1:$C1))>0))))
 
Upvote 0
Solution
ERROR: "FILTER has mismatched range sizes. Expected row count: 42, column count: 1. Actual row count: 73, column count: 1."

ERROR: "Array arguments to CONCAT are of different size."

Editing Cells G56 and down I used both ROWS and COUNTA in different cells to see which would work, but neither did, so I thought I'd share my sheet to make it easier for you.
 
Upvote 0
Nevermind, I figured it out:

For my formula for the 1st part I used:

=(if($B56="","",join(", ",FILTER(INDEX($F$10:$P$51,0,ROWS($G$56:$G56))&" "&$B$10:$B$51,INDEX($F$10:$P$51,0,ROWS($G$56:$G56))>0))))

When I'd used this earlier it hadn't worked. IDK why.
 
Upvote 0
With the error you describe it sounds like you had a typo in one of the ranges, based on the error information it would suggest that you perhaps had $82 instead of $51 in one of the index ranges, although that does seem like an extremely unlikely typo.
 
Upvote 0
With the error you describe it sounds like you had a typo in one of the ranges, based on the error information it would suggest that you perhaps had $82 instead of $51 in one of the index ranges, although that does seem like an extremely unlikely typo.
I don't actually know what I did to fix it. It wasn't a typo. I have copied and pasted the formula as you had typed it and then just changed cell and range references to fit my sheet. I had the same problem with a query function I had typed. I didn't make any changed, just copy and pasted formulas I had checked worked before had, but for some reason it didn't work, and then just as I was typing up a post on this forum about it, it magically worked.
 
Upvote 0

Forum statistics

Threads
1,223,634
Messages
6,173,475
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top