Consulting

Results 1 to 5 of 5

Thread: Another Option Instead of Using Multiple SumIfs?

  1. #1
    VBAX Regular
    Joined
    Sep 2011
    Posts
    42
    Location

    Another Option Instead of Using Multiple SumIfs?

    Hi guys,

    I am trying to find another way to sum data besides using multiple SumIf statements.

    The workbook attached has a copy of a file I import monthly. I need to combine several of these rows into one category description (i.e rows 8-33 equals “Sales”, rows 49-126 equals “Cost of Sales”, rows 46-47 equals “Discounts”, etc).

    I could use sum if to get the totals, however the formula gets long and hard to read. Plus, if additional GL accounts are added or removed, editing the formula would be a nightmare, ie for each GL Acct use SUMIF($A:$A,4000.000,$C:$C)+SUMIF($A:$A,4000.001,$C:$C), etc, etc


    The problem is I have six subsidiaries so I have to import the file 6 times, but the exact range locations aren’t the same.

    I can’t think of any other way to do this besides manually creating the sum if formulas on a seperate worksheet, which I could then dump in each file to get the totals which would be picked up on a summary wks. Is there any array or UDF that might be easier? I just need an example for one range as I can sort of read coding.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    VBAX Mentor Teeroy's Avatar
    Joined
    Apr 2012
    Location
    Sydney, Australia
    Posts
    414
    Location
    If you are trying to collate sales, cost of sales etc. and have excel 2007 or later try =SUMIFS($C:$C,$A:$A, ">=4000",$A:$A,"<5000"), this will give you sales, and so on. You should be able to refine the criteria to get whatever splits you are after.

    If you don't have excel 2007 or later, you could change the GL numbers to text and use wildcards in the SUMIF, such as =SUMIF($A:$A,"4*.???",$C:$C ), but it is less elegant.
    _________________________________________________________________________
    "In theory there is no difference between theory and practice. In practice there is." - Chuck Reid

    Any day you learn something new is a day not wasted.

  3. #3

    Solution attached

    Hi Jaydee,

    Attached is a solution hope you find useful.
    Kindly follow the instructions carefully.

    Happy Excelling
    Regards
    Attached Files Attached Files
    Last edited by parttime_guy; 11-01-2012 at 09:06 PM.

  4. #4
    VBAX Regular
    Joined
    Oct 2012
    Posts
    10
    Location
    SUMPRODUCT is another really great formula that accompishes CountIf, SumIf and LookUp results. Plus it has some advantages: I believe SUMPRODUCT works with closed workbooks unlike the other three.

  5. #5
    VBAX Regular
    Joined
    Sep 2011
    Posts
    42
    Location
    Thanks guys, especially teeroy (always helping me out ^_^) and parttime_guy. Both worked great, saved me a bunch of time! Have a great weekend!

Posting Permissions

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