Variable cell referencing in a function

hello. is there a way to get a function to act on cell designations that are variables?
i have =sum(a1:z1) and i would like to use a variable as the second cell in the sum function i.e e.g. substitute b1 or n1 for z1 and have the second postion in the =sum() function look to the text cell where i input the text b1 or n1. i am guessing =sum(a1:$$variable)
or some such.
thank you for your time

1 Like

=sum(E5:indirect(D2))

1 Like