I see, then you can use this set of formulas:
Assuming you have the value of starting range (in your example, 2) in D1, use this formula in E1
=ADDRESS(SMALL(IF($A$1:$B$12=$D1,ROW($A$1:$B$12)),1),SMALL(IF($A$1:$B$12=D1,COLUMN($A$1:$B$12)),1))
This will return the Cell reference containing that value (closest to the left and up - having smallest row and column number as possible)
And you have the ending range (in your example, 9) in D2, use this formula in E2
=ADDRESS(LARGE(IF($A$1:$B$12=$D2,ROW($A$1:$B$12)),1),LARGE(IF($A$1:$B$12=D2,COLUMN($A$1:$B$12)),1))
This will return the Cell Reference containing that value (furthest to the right and down - having largest row and column number as possible)
And this one to calculate the sum of that range using E1 and E2
=SUM(INDIRECT(E1&":"&E2))
Here is a sample file.
Bookmarks