+ Reply to Thread
Results 1 to 7 of 7

Reverse of sumproduct : product of product of array?

  1. #1
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2019 for Mac
    Posts
    26

    Reverse of sumproduct : product of product of array?

    Hi,

    I have two columns of data, with the following unique values in A1:A6

    Please Login or Register  to view this content.
    and the following in B1:B6

    Please Login or Register  to view this content.
    In C1:C2 and in C4 I have three criteria

    Please Login or Register  to view this content.
    And finally I use the following array formula to try to find the product of cells in column B that are in the rows of cells in column A that match criteria in C1:C2 and C4.

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


    If I use SUM() instead of PRODUCT(), it returns the correct value (3.5), but the above formula returns 0. I want it to return 2*0,5*1 = 1.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Reverse of sumproduct : product of product of array?

    Try...
    =PRODUCT(IF(ISNUMBER(SEARCH(C1:C6,B1:B6)),B1:B6,""))

    Confirmed as array (CTRL + SHIFT + ENTER)
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2019 for Mac
    Posts
    26

    Re: Reverse of sumproduct : product of product of array?

    Quote Originally Posted by CK76 View Post
    Try...
    =PRODUCT(IF(ISNUMBER(SEARCH(C1:C6,B1:B6)),B1:B6,""))

    Confirmed as array (CTRL + SHIFT + ENTER)
    Thanks, this seemed to work at first but a couple things:
    • It's important (for where this fits into my less simplified spreadsheet) that the criteria range is discontiguous, so something like {C1:C2;C4} etc., not {C1:C6}.
    • The formula doesn't work if I use different example letters for the criteria (e.g. C1="A", C2="D", C4="C" which should have product of 1*0,125*2=0,25, but returns 1), or if I move the criteria range around (C1="C", C2="F", C5="B" which should be 2*0,5*1=1, but returns 0,125).

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Reverse of sumproduct : product of product of array?

    Oh, had typo.
    =PRODUCT(IF(ISNUMBER(SEARCH(C1:C6,A1:A6)),B1:B6,""))

    Edit: Oh I see. I had misread. Why the non-contiguous range for criteria?

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


    Confirmed as array (CTRL + SHIFT + ENTER)
    Last edited by CK76; 11-20-2019 at 04:19 PM.

  5. #5
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2019 for Mac
    Posts
    26

    Re: Reverse of sumproduct : product of product of array?

    Quote Originally Posted by CK76 View Post
    Oh, had typo.
    =PRODUCT(IF(ISNUMBER(SEARCH(C1:C6,A1:A6)),B1:B6,""))

    Edit: Oh I see. I had misread. Why the non-contiguous range for criteria?
    Yeah I assumed you meant this and edited it like above, but still not working properly as described.

    Discontiguous because I have criteria used as other things in a big table and it'd be a hassle to move them to be adjacent without breaking other things.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Reverse of sumproduct : product of product of array?

    I've edited previous post. Check the new formula and see if that works.

  7. #7
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2019 for Mac
    Posts
    26

    Re: Reverse of sumproduct : product of product of array?

    Quote Originally Posted by CK76 View Post
    I've edited previous post. Check the new formula and see if that works.
    Your edited formula seems to work well, thanks very much.

+ 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. [SOLVED] Replacement product finder - Searching for matches based on various product attributes
    By gingert88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2017, 01:17 PM
  2. Replies: 9
    Last Post: 10-16-2014, 07:46 AM
  3. Replies: 2
    Last Post: 09-10-2014, 08:56 AM
  4. [SOLVED] I'm receiving a Run-Time error 1004 while trying to delete a product from a product list.
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2014, 10:03 PM
  5. Replies: 1
    Last Post: 06-20-2014, 03:38 PM
  6. [SOLVED] Find Product Details in Another Sheet based on Product ID and Copy some Fields From there
    By kevalkothari in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2012, 10:43 AM
  7. [SOLVED] Need Function that will find ordered product, and display the product code in a 2nd workbk
    By rollerden in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2012, 08:52 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