unknown range

dyc428

New Member
Joined
Apr 18, 2006
Messages
8
If I want to sum up #'s of a column but the number of values change.

how can I count up the number of #'s in the column so i can replace * with the count?

SUM(A1:A*)

* is how many numbers are in the column
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi, welcome to the board!

Will you have any blank cells in the column?

If not I think you could use:
=SUM(OFFSET($A$2,0,0,COUNTA($A$2:$A$65536),1))

* This assumes A1 contains a label....

Good luck :)
 
Upvote 0
Fairwinds, what's the +307 do? Seen this a few times (I think) but still haven't grasped the concept yet??
 
Upvote 0
It is just how you show a big number. I think it is called scientific notation in english.

9.99999999999999E+307
is actually the largest number you manually can enter in excel.
 
Upvote 0
Cool, that's worth remembering.

Can I be a pain and ask why this formula works? From my perspective this would be the same as =SUM(A1:26) *in my example*, yet it works perfectly?

I.e. in my example the INDEX(MATCH()) returns 26 (thats how many rows of numbers I have)...?
 
Upvote 0
When you use a formula like LOOKUP, VLOOKUP with last condition TRUE or MATCH with last condition 1 or omitted, i.e. funktions that looks for the largest value less than or equat to lookup value in a sorted list, you will, if you use a lookup value larger than any value in the range, get the last numerical value as return.
 
Upvote 0
Sorry Fairwinds I'm still lost, I get the concept of the lookup finding the last value by using the higest number, but I'm stuck on why it returns =SUM($A$1:$A$27)
Book3
ABCD
1Number #
21Formula26
31
41
51
61
71
81
91
101
111
121
131
141
151
161
171
181
191
201
211
221
231
241
251
261
271
Sheet1


This is the outcome if I evaluate the formula:
E1: =SUM(A1:INDEX(A:A,MATCH(9.99999999999999E+307,A:A)))

E2: =SUM($A$1:INDEX($A:$A,27))
(q) why do the references become fixed ($)?

E3: =SUM($A$1:$A$27)
(q) INDEX($A:$A,27) returns a value of 1, why does it create cell reference $A$27?

I would love to understand the logic behind this, far more useful than using the COUNTA() since COUNTA() is constrained by empty cells within the range.

Thanks. :)
 
Upvote 0
=INDEX(A:A,MATCH(9.99999999999999E+307,A:A))

does actually not return a value when used in a formula like this. It returns a range, in this case A27. (If you put the formula in the sheet it will return the contents of that range i.e. 1).


So in this case the formula should be evaluated as:

=SUM(A1:INDEX(A:A,MATCH(9.99999999999999E+307,A:A)))

=SUM(A1:A27)
 
Upvote 0
Thanks for the help guys,

I want to learn about writing macros. I was wondering if anyone knows a beginner book I can get that has plenty of examples and exercises.

Thanks
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,358
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top