Sum data based on coordinates

chris3131

New Member
Joined
May 19, 2015
Messages
9
a
b
c
d
1
5
2
7
100
2
10
4
14
200
3
15
6
21
300
4
2
8
28
400

<tbody>
</tbody>

If I have a table like the one above with column and row headers...NB. these are not the Excel headings, they are specific to the table and could appear anywhere on a worksheet.
I want to be able to specify coordinates (single, multiple, rows and columns) and have a consistent formula return the sum.
eg.
b3: formula returns: 6
b3,c2: formula returns: 20
d1:d3: formula returns 600
a2:d2: formula returns: 228

I don't mind how the coordinates have to be written in order to get the appropriate formula to work.eg. the row/column coordinate can be in a single cell, or in separate cells. However what is key is that the user is able to enter those coordinates in a consistent manner and have a consistent formula return the result.

Similar tables will be on multiple worksheets, so I would like the user to also be able to specify the worksheet and have the consistent formula return he value from the right table on the right worksheet. If range names can but used to reference the dataset/row headers/col headers then all the better.

Thanks in advance
 
Great solution Dante. But unfortunately I need a non-VBA way of doing this....if that’s possible??

See if this does what you need


A
B
C
D
E
F
G
H
I
J
K
L
M
N
1
a​
b​
c​
d​
Some​
Areas/Cell​
LeftCellRow​
LeftCellCol​
RightCellRow​
RightCellCol​
Result​
2
1​
5​
2​
7​
100​
16​
1​
1​
b​
1​
b​
2​
3
2​
10​
4​
14​
200​
45​
2​
1​
a​
4​
a​
32​
4
3​
15​
6​
21​
300​
721​
3​
2​
c​
2​
some​
259​
5
4​
2​
8​
28​
400​
48​
4​
4​
b​
1​
d​
1090​
6
5​
3​
7​
9​
11​
85​
5​
7
TOTAL​
1383​

<tbody>
</tbody>


Formula in N2 copied down
=IF(OR(J2="",K2=""),"",SUM(INDEX($C$2:$G$6,MATCH(J2,$B$2:$B$6,0),MATCH(K2,$C$1:$G$1,0)):INDEX($C$2:$G$6,MATCH(L2,$B$2:$B$6,0),MATCH(M2,$C$1:$G$1,0))))

Formula in N7
=SUM(N2:N6)

Remark:
The user must enter the coordinates as follows
1. a single cell
Repeat the coordinates in columns J: K and L: M
2. An area
Insert the coordinates of the leftmost cell in columns J: K; insert the coordinates of the rightmost cell in columns L: M

Hope this helps

M.
 
Last edited:
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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