+ Reply to Thread
Results 1 to 9 of 9

countif/sumif with more criterias - too complex for countifs/sumifs

  1. #1
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    countif/sumif with more criterias - too complex for countifs/sumifs

    Hi all,

    please find attached a sample worksheet I prepared to help me explain my problem. It is a bit more complex so please bare with me. I have a table consisting of 18 fixed columns. Column A, E and R show the 3 different customers, 3 different areas and 11 different classes, respectively.Duplications can occur in these columns. Columns B - D and F - Q consist of important data which can be neglected for now but cannot be deleted. The 3 tables below illustrate the prices for each customers depending on the classes. I would like to find out how much money is needed in each area. I manually calculated what the results should be.

    It is very important that in the original worksheet there are 3 different customers, 26 different areas and 14 different classes.

    thanks in advance for your help.

    I am looking forward to hearing from you.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    The format you have your customer pricing data in is making this task significantly harder than it needs to be.

    I've put it in a more accessible format and added the formula you need - would this be OK for you?
    Attached Files Attached Files

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    I was work on this and i didn't see Andrew's suggestion. I agree with him about the format.

    But as i worked on this, i give you another solution with your data as they are in your example.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    @Fotis - Nice, but you could have used a generic formula for your hidden column, to allow for more customers being added:

    =INDEX(OFFSET($B$19:$B$29,0,MATCH(A3,$17:$17,0)-1),MATCH(R3,OFFSET($A$19:$A$29,0,MATCH(A3,$17:$17,0)-1)))
    Last edited by Andrew-R; 01-03-2013 at 05:31 AM. Reason: Shockingly poor English

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    @ Andrew. Thank you. It's an honor for me

    I see that Mengo85, in first post told this.

    ....It is very important that in the original worksheet there are 3 different customers, 26 different areas and 14 different classes.
    But in any case i don't think that i was able to offer your excellent formula.

    Thanks for sharing with us this.

  6. #6
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    Hi guys,

    thank you so much for your help! You are amazing! The second solution Andrew-R suggested works on the sample worksheet but when I implemented it into my original worksheet #N/A appears. I put the extra column S in a completely new worksheet. I have t say that the big table is on one sheet, the customers are on a second and the end result is on a third sheet. Am I running into problems with the offset there?

    Thanks in advance.

  7. #7
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    The formula I suggested needs to include the sheet reference. I've put demonstration ones in the formula below:

    =INDEX(OFFSET(Sheet2!$B$19:$B$29,0,MATCH(A3,Sheet2!$17:$17,0)-1),MATCH(R3,OFFSET(Sheet2!$A$19:$A$29,0,MATCH(A3,Sheet2!$17:$17,0)-1)))

    Does that help?

    Edited to add: In case it's not clear, that refers to the sheet where your customer lookups are. The ranges will also need to be adapted.

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    Quote Originally Posted by Andrew-R View Post
    @Fotis - Nice, but you could have used a generic formula for your hidden column, to allow for more customers being added:

    =INDEX(OFFSET($B$19:$B$29,0,MATCH(A3,$17:$17,0)-1),MATCH(R3,OFFSET($A$19:$A$29,0,MATCH(A3,$17:$17,0)-1)))
    Or, assuming that the classes are consistant as in the sample
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If each table can have different classes
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    These options aren't volatile.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Registered User
    Join Date
    07-06-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    Guys,

    it worked. I had a format error which I now solved. Thank you so much! Happy new year!

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: countif/sumif with more criterias - too complex for countifs/sumifs

    You are welcome from all of us.

    Thanks for the reb*

    Happy new year to you too!

    @Marcoll Nice!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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