#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default 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)

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default 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)

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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)



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default variable formula

thank you

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default variable formula

You're welcome!

--
Biff
Microsoft Excel MVP


"LP23294" wrote in message
...
thank you





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DDE formula with variable Bruce Excel Worksheet Functions 0 November 16th 07 09:03 AM
Using a variable in a formula [email protected] Excel Discussion (Misc queries) 1 December 29th 06 11:46 AM
Using a variable in a VBA formula Colin Vicary Excel Discussion (Misc queries) 3 November 8th 05 11:39 AM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
Using a second variable within a formula... Ed Anton Excel Discussion (Misc queries) 2 February 18th 05 11:51 AM


All times are GMT +1. The time now is 08:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"