+ Reply to Thread
Results 1 to 4 of 4

Array constant in a SUMPRODUCT function needs to be converted to cell references

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    347

    Array constant in a SUMPRODUCT function needs to be converted to cell references

    Hi everyone,

    I have a simple formula as: =SUMPRODUCT(1*(A1:A100={1,2}))

    But I want to make it more flexible rather than using the array constant {1,2}. Suppose I want to use cell C1 and C2 to store these two values of 1 and 2, and use C1 and C2 in the formula. How to achieve that?

    One formula is something like: =SUMPRODUCT((A1:A100=C1)+(A1:A100=C2)). But this is still not neat enough. I prefer the use of brackets {} for this example

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

    Re: Array constant in a SUMPRODUCT function needs to be converted to cell references

    Try this...

    =SUMPRODUCT(COUNTIF(A1:A100,C1:C2))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    347

    Re: Array constant in a SUMPRODUCT function needs to be converted to cell references

    Thanks, Tony. It works nicely.

    Regards

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

    Re: Array constant in a SUMPRODUCT function needs to be converted to cell references

    You're welcome. Thanks for the feedback!

+ 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. Using the OR function with an array constant
    By Michael Kuchman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-21-2014, 08:58 PM
  2. Macro to Scan table array for value from Cell, Value is not constant
    By levl91 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2013, 08:53 AM
  3. Replies: 1
    Last Post: 03-20-2013, 10:18 PM
  4. [SOLVED] Sumproduct Function with Other Function References
    By T86157 in forum Outlook Formatting & Functions
    Replies: 4
    Last Post: 07-30-2012, 04:56 PM
  5. User Defined Function: multiply array by a constant
    By laterdaysluke in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-24-2008, 06:06 PM
  6. Keeping cell references constant
    By FlyingDutchmanIam in forum Excel General
    Replies: 1
    Last Post: 06-29-2006, 06:50 AM
  7. [SOLVED] Build an array constant with DATE function
    By CliffD in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2006, 09:55 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