Consulting

Results 1 to 4 of 4

Thread: Trouble with calculations in Excel table

  1. #1
    VBAX Newbie
    Joined
    Jul 2013
    Posts
    2
    Location

    Trouble with calculations in Excel table

    Hey,


    I have a table of number sof high-rise buildings in the US (attached here). What I'm trying to do (with formula or code) is to compute how many buildings there are (in all the US) with 14 floors. How many with 15 floors. Etc. with each number of floors. I am beginner-level with VBA. I started by sorting everything according to number of floors, then writing a For loop to go through the rows and start adding the numbers, but I ran into trouble that I didn't know how to handle (know when it's the first instance of that number of floors in order to start counting anew form there, etc.). You can see my code (very preliminary) in the file.


    I need something like this (for all numbers of floors):


    14 floors - 400 (buildings)
    15 floors - 250
    ...




    After that, I also need to do the same thing, but this time divided by States, meaning:


    AK:
    14 floors - 100
    15 floors - 50
    (for each state and for each number of floors)




    I would be really glad for help with this issue.. too many little details that I'm not sure how to handle.
    Thanks a lot!

    Here's the file (just remove spaces, file was too large for attachment):

    ht tps: //docs . google . co m/file/d/0B-4vUrIGZBqoMktsN1VYSU5aSDg/edit?usp=sharing​

  2. #2

  3. #3
    VBAX Newbie
    Joined
    Jul 2013
    Posts
    2
    Location
    Thanks folks but I got help in another forum.

  4. #4
    Moderator VBAX Wizard SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,488
    Location
    For the national counts:
    In column AB, starting in AB2 list the possible floor numbers,ie;12 to 105.

    In Column AC2 place this formula
    =SUMIF(C:C,AB2,Z:Z)
    Copy it down to the bottom of the list of floor numbers

    I don't understand the problem with state counts, you already have those results in column AB
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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