+ Reply to Thread
Results 1 to 4 of 4

formula - vba to summarize by money category

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    35

    formula - vba to summarize by money category

    Hello,

    Could anybody help me find a formula for the following case:

    say i've got 1000 rows in column H that give an amount net per company
    I need the exact total amount and the total of the companies that are in the following money category:

    Category
    > 50.000 €
    > 25.000 € <= 50.000 €
    > 10.000 € <= 25.000 €
    > 5.000 € <= 10.000 €
    > 1.000 € <= 5.000 €
    > 25 € <= 1.000 €
    < 25 €
    Total

    The total is made via the sum total function.

    Does anyone have a formula or VBA code to do this job in a fast manner. For the moment being i use a filter on the column but this takes some time...

    Thanks a lot for your help!

  2. #2
    Registered User
    Join Date
    04-12-2013
    Location
    nowhere
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: formula - vba to summarize by money category

    I don't really understand the ranges for your 'bins' - specifically, why is there a range under the ">1 <=5" category that reads ">25 <=1" (which doesn't make sense), and below that "<25"? But in general, if you just want a count of the number of companies in each bin, just list the lower and upper bounds of each bin in two adjacent columns - like this:
    ColA Col B
    50 100000000
    25 50
    10 25
    5 10
    1 5
    0 1

    And in the next column over (in this case, C), use SUMPRODUCT() to count the values in your column H that are within each bin:

    =SUMPRODUCT((H$2:H$10000>A2)*(H$2:H$10000<=B2)) and drag down as far as your list of bins go - in this case (C2:C7)

  3. #3
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: formula - vba to summarize by money category

    @ brownfox, that is european number formatting, read '.' as ','
    @Fugazi_Dent, see attached

    Hope this helps
    Attached Files Attached Files
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  4. #4
    Registered User
    Join Date
    04-12-2013
    Location
    nowhere
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: formula - vba to summarize by money category

    @dredwolf ah, thanks - that somehow escaped me. That is why you are a wolf and I am a mere fox

+ 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