Using Variables in Summing Formulas in Excel/Open Calc

Click For Summary

Discussion Overview

The discussion revolves around the use of variables in summing formulas within spreadsheet applications like Excel and Open Calc. Participants explore how to dynamically reference a range in a SUM function based on a variable value.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant inquires about summing a range from A1 to a cell determined by adding a variable value (F4) to A1, specifically wanting to achieve a formula like SUM(A1:A(1+F4)).
  • Another participant suggests using the INDIRECT() function to construct the range dynamically, providing the formula =SUM(INDIRECT("A1:A"&F4)) as a solution.
  • A third participant expresses gratitude for the suggestion provided.
  • A later reply challenges the initial formula proposed by the first participant, stating that it is incorrect and suggesting the use of a + sign instead.

Areas of Agreement / Disagreement

There is no consensus on the correct formula, as participants present differing views on how to properly construct the summing formula using variables.

Contextual Notes

Participants have not resolved the mathematical correctness of the proposed formulas, and there may be assumptions regarding the use of functions like INDIRECT() that are not fully explored.

Kuryakin
Messages
10
Reaction score
0
In excel, using Open Calc but I assume they're the same.

Is their a way to put variables value into summing formulas. I wanted to sum from A1 to an A cell which is numbered A1+F4. So if F4 = 100 I'd want to SUM(A1:A101)
I tried SUM(A1:A(1+F4)) but it gives a number error
 
Computer science news on Phys.org
Hi, ok you need to use a function called "INDIRECT()".

Example: =SUM(INDIRECT("A1:A"&F4))

Note: & is the concatenation operator, not +.
 
Thank-you.
 
SUM(A1:A(1+F4)) this formula i don't think is correct.
simply use with + sign
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
9
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 61 ·
3
Replies
61
Views
5K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
8
Views
3K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K