+ Reply to Thread
Results 1 to 8 of 8

Evaluating commonality across multiple datasets

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    London, UK
    MS-Off Ver
    Office 365 ProPlus
    Posts
    18

    Evaluating commonality across multiple datasets

    Hi - I'm trying to compare the similarity in two datasets, and am trying to produce formula (without helper columns) that i) count the number of discrete entries that are also common in two ranges, and ii) sums a corresponding value for entries common in two ranges. Attached is an example worksheet. I'm assuming either a sumproduct-countif/sumif might work, but don't seem to be having much luck. Also the datasets are quite large, which also makes countif challenging. I'd be grateful for any help!
    Attached Files Attached Files

  2. #2
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Evaluating commonality across multiple datasets

    I think you are looking for
    =SUM(SUMIF(B4:B16,{"AAA","BBB","DDD"},C4:C16))/SUM(C4:C16)

    =SUM(SUMIF(B:B,{"AAA","BBB","DDD"},C:C))/SUM(C:C) - will be the same.

  3. #3
    Registered User
    Join Date
    01-02-2013
    Location
    London, UK
    MS-Off Ver
    Office 365 ProPlus
    Posts
    18

    Re: Evaluating commonality across multiple datasets

    Thanks BMV, although this doesn't seem to work for me. The array needs to be defined as a range, rather than a set number of options (since there are hundreds of discrete values), something along the following lines (but this doesn't seem to work);

    =SUM(SUMIF(B:B,{C:C},C:C))/SUM(C:C)

    Also, this helps with the sum of common entries, but not the discrete count. Any thoughts? Thanks again!

  4. #4
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Evaluating commonality across multiple datasets

    This doesn't seem to be clear what you would like to calculate. {"AAA","BBB","DDD"}, -the list of values and if you place it to the range X1:X3 then =SUM(SUMIF(B:B,X1:X3 ,C:C))/SUM(C:C) and finish formula CTRL+SHIFT+ENTER

  5. #5
    Registered User
    Join Date
    01-02-2013
    Location
    London, UK
    MS-Off Ver
    Office 365 ProPlus
    Posts
    18

    Re: Evaluating commonality across multiple datasets

    Unfortunately this formula produces a sum that exceeds the actual sum of the column. The goal here is to be able to say "x% of range 1 entries also appear in range 2".

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Evaluating commonality across multiple datasets

    Try these

    In I20
    =SUMPRODUCT(--(ISNUMBER(MATCH(B4:B16,D4:D16,0))))


    In I21
    =SUMPRODUCT((ISNUMBER(MATCH(B4:B16,D4:D16,0)))*(1/COUNTIF(B4:B16,B4:B16)))


    In I22
    =SUMPRODUCT((ISNUMBER(MATCH(B4:B16,D4:D16,0)))*(C4:C16))/SUM(C4:C16)


    In I23
    =SUMPRODUCT((ISNUMBER(MATCH(D4:D16,B4:B16,0)))*(E4:E16))/SUM(E4:E16)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  7. #7
    Registered User
    Join Date
    01-02-2013
    Location
    London, UK
    MS-Off Ver
    Office 365 ProPlus
    Posts
    18

    Re: Evaluating commonality across multiple datasets

    Excellent! Many thanks, this works perfectly.

  8. #8
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: Evaluating commonality across multiple datasets

    =COUNT(MATCH(B4:B16,D4:D16,)) - Array formula for I20
    or
    =SUMPRODUCT(SIGN(COUNTIF(D4:D16,B4:B16)))
    for i21
    =SUMPRODUCT(SIGN(COUNTIF(D4:D16,B4:B16))/COUNTIF(B4:B16,B4:B16))
    or
    =SUMPRODUCT((COUNTIF(D4:D16,B4:B16)>0)/COUNTIF(B4:B16,B4:B16))
    and for i22
    =SUMPRODUCT(SIGN(COUNTIF(D4:D16,B4:B16))*C4:C16)/SUM(C4:C16)
    or
    =SUMPRODUCT((COUNTIF(D4:D16,B4:B16)>0)*C4:C16)/SUM(C4:C16)

    Ace_XL Why so many brackets
    =SUMPRODUCT(ISNUMBER(MATCH(B4:B16,D4:D16,))/COUNTIF(B4:B16,B4:B16))
    =SUMPRODUCT(ISNUMBER(MATCH(B4:B16,D4,D16,))*C4:C16)/SUM(C4:C16)

+ 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. Combine multiple datasets into one
    By barrymac20 in forum Excel General
    Replies: 9
    Last Post: 03-08-2019, 07:28 PM
  2. [SOLVED] Evaluating a formula for multiple inputs and getting multiple outputs
    By BREOL in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 02-17-2016, 02:11 AM
  3. Displaying multiple datasets on one graph
    By samfau2 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-02-2014, 09:11 AM
  4. Enjoying the power of Excel VBA with multiple datasets
    By euclidean in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 04-09-2013, 05:22 AM
  5. Multiple Graphs From Many Unique Datasets
    By Austin1984 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-28-2010, 06:43 AM
  6. Determine top % contributors from multiple datasets
    By arsenoell in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-16-2010, 09:06 PM
  7. Macro for multiple charting of multiple datasets
    By mmf144 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2006, 11:17 AM

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