Using Variables in Summing Formulas in Excel/Open Calc

AI Thread Summary
In Excel, to sum a range where the endpoint is determined by a variable, the INDIRECT function is essential. For instance, to sum from A1 to a cell defined by A1 plus a value in F4, the correct formula is =SUM(INDIRECT("A1:A"&F4)). The ampersand (&) is used for concatenation, not the plus sign (+), which is crucial for constructing the range correctly. Using the incorrect formula, such as SUM(A1:A(1+F4)), will result in a number error.
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
 
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
Back
Top