# Excel sum with relative positions

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!)

3548 主题

670 人气