0

I did try to enter in a cell formula:

=SUM(ADDRESS(ROW(),COLUMN()+1):ADDRESS(ROW(),COLUMN()+2))

Intention is summing next 2 cell in the same row.
But the spreadsheet complains with error on it!

Used functions: ADDRESS(ROW(),COLUMN()+1). Work fine but together - not! In B7 cell:

(I need to write a generic formula that is independent from location and calculates the sum of the next tho cell in the same row.
I am not interested in specific addresses or in a way to copy any specifically written formula across a spreadsheet.
I need a formula that works independently from a location!
Is it possible in Excel at all?)
Thanks.

N. Pavon
  • 821
  • 4
  • 15
  • 32
alex5161
  • 19
  • 5

2 Answers2

1

ADDRESS returns address as a string. You cannot SUM it because SUM(A2:A3) is very different from SUM("A2:A3").

You could look into SUM(INDIRECT("A2:A3")), but you should not, for the mere reason that Excel's formulas are already relative unless made absolute.

If you want to sum two cells to the right of B7, enter =SUM(C7:D7) to B7. The formula will change if you copy it to another cell.

If you meant to enter the formula with a macro, then use the R1C1 notation and enter =SUM(RC[1]:RC[2]).

Community
  • 1
  • 1
GSerg
  • 76,472
  • 17
  • 159
  • 346
0

sorry im dont speak english , but a have what you need

= SUM(INDIRECT(CONCATENATE(ADDRESS(ROW();COLUMN()+1);":"; ADDRESS(ROW();COLUMN()+2))))

Regards

Gustavo Miño
  • 91
  • 1
  • 7