ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   variable formula (https://www.excelbanter.com/excel-worksheet-functions/246715-variable-formula.html)

LP23294

variable formula
 
how do i write a formula to do a variable sum calculation. ie i have a column
of numbers in A from A5 going down to A25. in cell F1 i have a value between
1 and 20. this example F1 = 7.
so the value in the formula would be A5+ the value in F1 (7) which would
equal A12.

so the final formual would be =sum(A5:A5+value in f1).
=sum(a5:a12)


Jacob Skaria

variable formula
 
Try

=SUM(OFFSET(A5,0,0,F1+1,1))

If this post helps click Yes
---------------
Jacob Skaria


"LP23294" wrote:

how do i write a formula to do a variable sum calculation. ie i have a column
of numbers in A from A5 going down to A25. in cell F1 i have a value between
1 and 20. this example F1 = 7.
so the value in the formula would be A5+ the value in F1 (7) which would
equal A12.

so the final formual would be =sum(A5:A5+value in f1).
=sum(a5:a12)


T. Valko

variable formula
 
so the final formual would be =sum(A5:A5+value in f1).
=sum(a5:a12)


Try this:

=SUM(A5:INDEX(A5:A25,F1+1))

If F1 is empty the result will be the sum of A5:A5.


--
Biff
Microsoft Excel MVP


"LP23294" wrote in message
...
how do i write a formula to do a variable sum calculation. ie i have a
column
of numbers in A from A5 going down to A25. in cell F1 i have a value
between
1 and 20. this example F1 = 7.
so the value in the formula would be A5+ the value in F1 (7) which would
equal A12.

so the final formual would be =sum(A5:A5+value in f1).
=sum(a5:a12)




LP23294

variable formula
 
thank you


T. Valko

variable formula
 
You're welcome!

--
Biff
Microsoft Excel MVP


"LP23294" wrote in message
...
thank you





All times are GMT +1. The time now is 01:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com