+ Reply to Thread
Results 1 to 5 of 5

Sumproduct with Array Constants as argument not working

  1. #1
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Sumproduct with Array Constants as argument not working

    Hello, I have the data as attached.

    the formula is:


    =SUMPRODUCT((D2:F8)*(C2:C8={"My new line","Your New Line"})*(D1:F1)=H1)

    which is not working. here I'm trying to calculate sum of 2017 revenue for "My new line" and "Your New Line". "H1" has "2017" in it.

    the {"My new line","Your New Line"} part needs to stay in this format as this is returned by a userform where they pick what revenue item(s) to sum.

    can someone please help? the formula didn't work either way as a regular nor an array formula.

    thanks!
    Attached Images Attached Images

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Sumproduct with Array Constants as argument not working

    Please try

    =SUMPRODUCT(($D$2:$F$8)*isnumber(match($C$2:$C$8,{"My new line","Your New Line"},))*($D$1:$F$1=H1))

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,394

    Re: Sumproduct with Array Constants as argument not working

    lynnsong,

    Not quite clear on this? If you are looking for only the sum of 2017 revenue for the selected elements in Col C, why are you including the values for 2018 and 2019 as well?

    Ochimus

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Sumproduct with Array Constants as argument not working

    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. Just before posting, scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.

  5. #5
    Forum Contributor
    Join Date
    06-19-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Office365
    Posts
    273

    Re: Sumproduct with Array Constants as argument not working

    thanks so much Bo_Ry!! your formula works like a charm!!

    the formula is written not in the year columns, that's why I need to use sumproduct in this way.

+ 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] Array constants
    By czlowiek121 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2018, 08:43 AM
  2. SUMPRODUCT Working with Array
    By antonywijesinghe in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-02-2018, 12:07 AM
  3. Array constants in a nested VLOOKUP
    By soneaf in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-03-2016, 01:00 PM
  4. [SOLVED] ByRef argument type mismatch / Passing array as a function argument
    By pzling in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2012, 06:23 PM
  5. SumProduct Array not working
    By Maudise in forum Excel General
    Replies: 4
    Last Post: 09-20-2011, 05:10 AM
  6. Dynamic array constants
    By michalrosa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2010, 04:01 AM
  7. [SOLVED] Function (array argument, range argument, string argument) vba
    By Witek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2005, 11:07 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