Question

In Excel, I have the following formula:

=SUBTOTAL(9;INDIRECT("D$"&$B$2&":D$"&$B$3))

It counts the values of a range, which size is defined in other fixed table cells.

  • B2 = starting point = 9
  • B3 = end point = 17

So in short:

=SUBTOTAL(9;D9:D17)

I now want to copy that formula to other cols in the same row, I want to pull it to the right (I don't know how that feature is called in Excel). How can I achieve, that only D changes to E and then to F and so on, by the base of my formula? The size of the range should remain the same and has to be linked to table cells B2 and B3.

Was it helpful?

Solution

It's normally better to use INDEX rather than INDIRECT in these type of formulas. One advantage is that the formula can be dragged across....try this version

=SUBTOTAL(9;INDEX(D:D;$B$2):INDEX(D:D;$B$3))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top