Excel sum with relative positions

Excel sum with relative positions

策马西风 发布于 2021-11-27 字数 372 浏览 865 回复 3 原文

How do I sum from whats in B2 to C2 ?

B2 = A10 or just 10 (preferred)
C2 = A25 or just 25 (preferred)

Normally you would just use SUM(A10:A25), but the values in B2 and C2 are not fixed, they change based on input.
I can use MATCH to find the numbers, but how do I tell SUM to use those numbers ?
The values to sum are always in the same column.

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

再可℃爱ぅ一点好了 2022-06-07 3 楼

Use the INDIRECT() function. You pass it a string that is a range, which allows you to have a dynamic range based on input.

岁月染过的梦 2022-06-07 2 楼

You want to specify Cell Co-ordinates in the value of a Cell ?

Is that what you're getting at ?

Try Setting

B1 = "A10"
C1 = "A25"
D1 = =SUM(INDIRECT(B1):INDIRECT(C1))
骄傲 2022-06-07 1 楼

You can use the INDIRECT function for this, e.g.

=SUM(INDIRECT(B2):INDIRECT(C2)) 

if you can live with entering the entire cell name (A10, A25).

Or to just have the numbers in B2 and C2, you could use

=SUM(INDIRECT(ADDRESS(B2;1)):INDIRECT(ADDRESS(C2;1)))

(Hope I got the columns and rows in the right order!)