+ Reply to Thread
Results 1 to 17 of 17

complex count if/vlookup/sumif with duplicates

  1. #1
    Registered User
    Join Date
    09-09-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    1

    complex count if/vlookup/sumif with duplicates

    Hi,

    Here is an example of my raw data, and what I would like to achieve with formulas. I hope that you can help.

    It's very simple data, but there is a lot of it and I'm sure there's a simple way of turning it into a neat table to analyse!

    Appreciate all your help.

    Thanks,

    Marta
    Attached Files Attached Files

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: complex count if/vlookup/sumif with duplicates

    In H6.. use Array Formula as

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    To confirm the formula, press Ctrl + Shift + Enter, Not just Enter...
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: complex count if/vlookup/sumif with duplicates

    H6 drag down
    =SUM(IF(FREQUENCY(IF(D6:D16<>"",IF($D$6:$D$16=G$6,MATCH("~"&C6:C16,C6:C16&"",0))),ROW(C6:C16)-ROW(C6)+1),1))

    Confirm COntrl+Shift+Enter

    I6:
    =SUMIF($D$6:$D$16,G6,$E$6:$E$16)
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  4. #4
    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: complex count if/vlookup/sumif with duplicates

    1 way could be this using SUMPRODUCT.

    =SUMPRODUCT(($C$6:C6=C6)*($D$6:D6=D6))

    =SUMPRODUCT(($D$6:$D$16=G$6)*($B$6:$B$16=1))

    =SUMPRODUCT(($D$6:$D$16=G6)*($E$6:$E$16))


    Comments?
    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.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: complex count if/vlookup/sumif with duplicates

    Try this array formula** entered in H6 and copied down:

    =SUM(IF(FREQUENCY(IF(D$6:D$16=G6,MATCH(C$6:C$16,C$6:C$16,0)),ROW(D$6:D$16)-ROW(D$6)+1),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Contributor
    Join Date
    07-02-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    197

    Re: complex count if/vlookup/sumif with duplicates

    Quote Originally Posted by RobertMika View Post
    H6 drag down
    =SUM(IF(FREQUENCY(IF(D6:D16<>"",IF($D$6:$D$16=G$6,MATCH("~"&C6:C16,C6:C16&"",0))),ROW(C6:C16)-ROW(C6)+1),1))

    Confirm COntrl+Shift+Enter

    I6:
    =SUMIF($D$6:$D$16,G6,$E$6:$E$16)
    martacm13, use RobertMika' formulas. They works!

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: complex count if/vlookup/sumif with duplicates

    My suggested formula also works and it's shorter and less complex!

  8. #8
    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: complex count if/vlookup/sumif with duplicates

    ...........

  9. #9
    Forum Contributor
    Join Date
    07-02-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    197

    Re: complex count if/vlookup/sumif with duplicates

    My apologies Tony, I forgot the CSE to your formula. I't works

  10. #10
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: complex count if/vlookup/sumif with duplicates

    No no.. choose my one..

    I will give you some discount also.. you don't have to use those $ signs..

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: complex count if/vlookup/sumif with duplicates

    ----------

  12. #12
    Forum Contributor
    Join Date
    07-02-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    197

    Re: complex count if/vlookup/sumif with duplicates

    Maybee I have to apologise also to Debraj. I could not execute that formula because COUNTIFS is not recognized in my Excel 2003 at work.

  13. #13
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: complex count if/vlookup/sumif with duplicates

    Fotis, do you mean $G6 and not G$6?
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  14. #14
    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: complex count if/vlookup/sumif with duplicates

    Quote Originally Posted by Jacc View Post
    Fotis, do you mean $G6 and not G$6?
    YES that is the correct if someone wants to drag the formula across. In this case even if anyone use the reference of the cell as i suggested the result will be ok.

  15. #15
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: complex count if/vlookup/sumif with duplicates

    But it refers to Alex on all three lines on your sheet, that can't be right? They could have different number of customers.

  16. #16
    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: complex count if/vlookup/sumif with duplicates

    Correct! We can use also without $ sign in this case.

    =SUMPRODUCT(($D$6:$D$16=G6)*($B$6:$B$16=1))

    Copy down.

  17. #17
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: complex count if/vlookup/sumif with duplicates

    Quote Originally Posted by Debraj Roy View Post
    No no.. choose my one..

    I will give you some discount also.. you don't have to use those $ signs..
    Yours is the most expensive..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SumIf with complex criteria
    By sdharris0303 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-03-2013, 04:19 PM
  2. [SOLVED] Using Match/Vlookup/ any others to count duplicates
    By excelnewbie80 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2012, 10:42 AM
  3. Replies: 4
    Last Post: 03-30-2012, 07:55 AM
  4. Complex SUMIF
    By alexmitchell in forum Excel General
    Replies: 2
    Last Post: 03-25-2012, 12:21 PM
  5. Identifying complex duplicates
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2006, 07:25 PM

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