Horizontal Sum (sum+match)

FlashDota

New Member
Joined
Jun 11, 2023
Messages
33
Office Version
  1. 2021
Platform
  1. Windows
I want to make this formula: =sum('MTD Data'!S11:U11) dynamic.
=MATCH(A11,'MTD Data'!$B1:$B,0) returns the number 11,
so instead of S11:U11 I want to take something like sum('MTD Data'!S(MATCH):U(MATCH)) that automatically returns S11:U11

What way is there do it?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
=SUM(INDIRECT(("S"&C2&":"&"U"&C2)))
will use a cell where you have the value 11
then you can just use the

so the match - returns the row number that =MATCH(A11,'MTD Data'!$B1:$B,0) finds

=SUM(INDIRECT(("S"&MATCH(A11,MTD Data'!$B1:$B100,0)&":"&"U"&MATCH(A11,MTD Data'!$B1:$B100,0))))

i have just kept on same sheet so you can see
Book7
ABCDEFGHIJKLMNOPQRSTU
1MATCH
26111=MATCH(A11,'MTD Data'!$B1:$B,0) returns the number 11,
32so instead of S11:U11 I want to take something like sum('MTD Data'!S(MATCH):U(MATCH)) that automatically returns S11:U11
43
54
6
7
8
9
10
111111123
12
13
Sheet1
Cell Formulas
RangeFormula
A2A2=SUM(INDIRECT(("S"&MATCH(A11,$B1:$B12,0)&":"&"U"&MATCH(A11,$B1:$B12,0))))
D2D2=MATCH(A11,$B1:$B12,0)
 
Upvote 0
You could use:

Excel Formula:
=SUM(INDEX('MTD Data'!$S:$U,MATCH(A11,'MTD Data'!$B:$B,0),0))

Are you using Google Sheets? $B1:$B is not a valid address in Excel.
 
Upvote 0
Solution
You could use:

Excel Formula:
=SUM(INDEX('MTD Data'!$S:$U,MATCH(A11,'MTD Data'!$B:$B,0),0))

Are you using Google Sheets? $B1:$B is not a valid address in Excel.
Thanks @RoryA this was the solution. Looks like I just skipped one step (the index)
And yes I am using google sheets in fact.
 
Upvote 0
And yes I am using google sheets in fact.
I'd suggest you mention that in future. There are things that work in Excel that will not work the same, or at all, in Sheets.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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