+ Reply to Thread
Results 1 to 6 of 6

Check if sumproduct array contains only unique values

  1. #1
    Registered User
    Join Date
    09-07-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    38

    Check if sumproduct array contains only unique values

    Dear All,

    I am facing a problem and can't get my head around it.

    Given:

    col A col B col C col D
    row 1 10 a 1.2 x
    row 2 20 b 1.1 y
    row 3 15 a 1.3 z
    row 4 30 a 1.4 x
    row 5 25 e 1.5 y

    So what my initial formula does - sums product of col A and C, provided col B has value "a": =SUMPRODUCT(A1:A5,C1:C5,--(B1:B5="a")). So it sums products of columns for rows 1,3 and 4. (since for rows 2 & 5, 3rd array in SUMPRODUCT returns 0.

    Where I would like to get is - as a separate formula: for those rows where third array returned 1, i.e. for rows where column B = "a", I would like to see if all values in column D in respective rows are the same. So, in this case: Look at D1, D3 & D4 and see if they are all the same. [in this case it is not, as when you compare x, z and x -> not all the same]. I don't even need the count of duplicates, simple 1/0 as the result would do.

    If you have any suggestions, would very much appreciate those.

    Many Thanks,
    Michael

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Check if sumproduct array contains only unique values

    Hi.

    Perhaps:

    =0+(SUMPRODUCT(0+(COUNTIFS(B1:B5,"a",D1:D5,D1:D5)=COUNTIF(B1:B5,"a")))>0)

    Regards
    Click * below if this answer helped

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

  3. #3
    Registered User
    Join Date
    09-07-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: Check if sumproduct array contains only unique values

    Hi Xor Lx,

    Many thanks, this does work!

    Could you please help out with the case when you have multiple criteria, ie:

    B1:B5 has to be "a",

    E1:E5 has to be "e"

    F1:F5 has to be "i"

    Cheers

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Check if sumproduct array contains only unique values

    Try:

    =IF(COUNTIFS(B1:B5,"a",E1:E5,"e",F1:F5,"i"),0+(SUMPRODUCT(0+(COUNTIFS(B1:B5,"a",D1:D5,D1:D5,E1:E5,"e",F1:F5,"i")=COUNTIFS(B1:B5,"a",E1:E5,"e",F1:F5,"i")))>0),"No Results")

    Regards

  5. #5
    Registered User
    Join Date
    09-07-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: Check if sumproduct array contains only unique values

    Perfect, thanks!

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Check if sumproduct array contains only unique values

    You're welcome!

+ 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. How to check if values are unique?
    By Fhorst in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2014, 04:45 PM
  2. SumProduct unique values across 2 columns
    By hazzlondon in forum Excel General
    Replies: 1
    Last Post: 07-19-2011, 12:05 PM
  3. Check: Ensure all Values in a Range Are Unique
    By JungleJme in forum Excel General
    Replies: 4
    Last Post: 04-14-2010, 09:33 AM
  4. Unique Values and sumproduct
    By SOS in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-27-2007, 10:09 AM
  5. check for duplicates, then sum unique values
    By Weissme in forum Excel General
    Replies: 0
    Last Post: 08-09-2006, 11:35 AM

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