+ Reply to Thread
Results 1 to 5 of 5

Sum across a variable range

  1. #1
    Registered User
    Join Date
    03-03-2010
    Location
    Raton, NM
    MS-Off Ver
    Excel 2003
    Posts
    8

    Sum across a variable range

    I have (and have had for some time) a dilemma that I cannot figure out. I am not that good with programming languages, which seems to exacerbate my problems.

    I have a spreadsheet that contains the landcover habitat descriptions for numerous properties and different ownerships. For example, Ranch X has Y acres of grass that is privately owned and Z acres of grass that is publicly owned. So there are multiple entries for each Ranch.

    I am trying to find a macro that will sum the acreages for each ranch (there are about 1,000 total ranches), but the range is variable for each ranch. For example Ranch X has 4 habitat types and 2 ownership values, but Ranch Y has 10 habitat types and 3 ownership values.

    Does anyone know the best way to go about this? Right now I have to create a sum for each individual ranch and I would like something that was a little less time consuming.

    Any help is greatly appreciated.

    Ryan

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum across a variable range

    Have you thought about/read up on/tried Pivot Tables?

    http://peltiertech.com/Excel/Pivots/pivotstart.htm

    http://datapigtechnologies.com/ExcelMain.htm

    http://www.ozgrid.com/Excel/PivotTab...CreatePiv1.htm
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Sum across a variable range

    You probably don't need a macro for this. Maybe a pivot table would work, maybe formulas. But it's impossible to tell without seeing what data you have and how it's laid out. Can you attach the workbook without disclosing private data?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    03-03-2010
    Location
    Raton, NM
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Sum across a variable range

    The Pivot Table works better than going through and doing everything by hand, but I wanted to try the Macro route so I could end up with the same output as another table so my tables would match and it would be a lot less busy work than the Pivot Table route.

    For now I will continue with the busy work. Thanks for the help.

  5. #5
    Registered User
    Join Date
    03-03-2010
    Location
    Raton, NM
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Sum across a variable range

    I can tell it's been a long day.

    By simply choosing the habitat types to include in the Pivot Table prior to starting the Pivot Table I got it to work just the way that I wanted it without all of the busy work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1