Computing.Net > Forums > Office Software > Keeping number of rows in Excel formula

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Keeping number of rows in Excel formula

Reply to Message Icon

Name: uhjb
Date: July 3, 2009 at 12:46:03 Pacific
OS: Windows XP
Subcategory: Microsoft Office
Comment:

If I have a formula in A1 that reads: =sum(a2:a5000) to get the sum of up to 5000 rows. Is it possible to have that value remains as 5000 after I insert or delete some rows? TIA.



Sponsored Link
Ads by Google

Response Number 1
Name: Mike (by mmcconaghy)
Date: July 3, 2009 at 13:59:47 Pacific
Reply:

You can use the =INDIRECT function:

In Cell B1 enter A5000

In Cell A1 enter =SUM(A2:INDIRECT(B1))

MIKE

http://www.skeptic.com/


0

Response Number 2
Name: DerbyDad03
Date: July 3, 2009 at 15:46:14 Pacific
Reply:

No need to "waste" B1.

=SUM(A2:INDIRECT("A5000"))

Keep in mind that in either case, you can't mess with Row 2. You will get a #REF error if you delete Row 2 or the Formula will change to =SUM(A3:INDIRECT("A5000")) if you insert a Row at 2.

If you want to lock in both the upper and lower cell, use this:

=SUM(INDIRECT("A2"):INDIRECT("A5000"))


0

Response Number 3
Name: uhjb
Date: July 6, 2009 at 12:56:59 Pacific
Reply:

Thank you for both of your input. I didn't know what INDIRECT was all about, and now I do…Thanks again.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Keeping number of rows in Excel formula

increase no of rows in excel shet www.computing.net/answers/office/increase-no-of-rows-in-excel-shet/8272.html

increase excel rows to over 65 536 www.computing.net/answers/office/increase-excel-rows-to-over-65-536/4217.html

Type of column in EXCEL www.computing.net/answers/office/type-of-column-in-excel/2162.html