+ Reply to Thread
Results 1 to 9 of 9

Avoid an Array Function by using Sumproduct

  1. #1
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Question Avoid an Array Function by using Sumproduct

    Hi All,

    I am trying to turn an array function which working well for me into a normal function just to reduce processing time in my workbook.

    I have the following array functions with some named ranges:

    =IFERROR(INDEX(RangeOfNames,MATCH(MIN(IF((RangeOfS.Dates<=$A3)*--(RangeofExp.Dates > ($A3+B$1)) > 0,(RangeOfS.Dates<=$A3)*(RangeofExp.Dates)*(RangeofExp.Dates>($A3+B$1)))),RangeofExp.Dates,0)),"None")

    =IF(B3="None","NA",IFERROR(INDEX(RangeOfNames,MAX(ROW(RangeOfNames)*(RangeOfS.Dates<=$A3)*(RangeofExp.Dates > =$A3)*(RangeofExp.Dates < VLOOKUP(B3,DataTable,3,0)))-1,1),B3))

    I have tried embedding the MIN and MAX functions inside a Sumproduct function with the intention of avoiding Array (Ctrl + Shift + Enter), but I dont get the same results (as derived by array functions) when I do so.

    Any help is appreciated,

    BR,

    Imran
    Last edited by AliGW; 08-28-2018 at 02:53 AM. Reason: Formulae added & attachment removed.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Avoid an Array Function by using Sumproduct

    1. SP can also be an array formula, depending on how it is used.
    2. Helper columns can help cut down processing time, and keep formulas simple.
    3. why would you upload a text document, when your question is regarding an excel file?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: Avoid an Array Function by using Sumproduct

    When I was adding my formula here, the system was blocking me

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Avoid an Array Function by using Sumproduct

    Blocking you from what?
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,838

    Re: Avoid an Array Function by using Sumproduct

    Quote Originally Posted by ibuhary View Post
    When I was adding my formula here, the system was blocking me
    That's because Sucuri does not like < and > without spaces either side. For simplicity, I've added spaces to your formulae and posted them in your opening post.

    However, you should upload the workbook as Ford has advised.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Contributor
    Join Date
    06-01-2014
    Location
    Riyadh, Saudi Arabia
    MS-Off Ver
    Microsoft 365
    Posts
    224

    Re: Avoid an Array Function by using Sumproduct

    if this is a possibility, I would like to know which part of the above functions I will have to embed inside the sumproduct in order to avoid the array method.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Avoid an Array Function by using Sumproduct

    I think we need to see a sample workbook, along with samples of your expected outcome.

  8. #8
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Avoid an Array Function by using Sumproduct

    Without seeing examples, judging from your formulas, it looks like your using them to pull text. If thats the case, SUMPRODUCT itself will not work as it will return numbers. You may be able to use SUMPRODUCT to get a row number as the argument for INDEX but its possible that it would not improve efficiency at all. We'd have to see the formula in context to know.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

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

    Re: Avoid an Array Function by using Sumproduct

    My recommendation, is to use alternate approach, if speed is prohibitive.

    1. PowerPivot - Using DAX, add measures/calculated field (avoid calculated columns as much as you can for performance).
    2. VBA - Using Collection/Dictionary and variant array, perform lookup operation.

    VBA will be much faster, but PowerPivot will allow for additional analysis using same model and is more flexible.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ 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. Replies: 3
    Last Post: 11-05-2015, 09:09 PM
  2. Help with Array Function: Avoid repeating values on MATCH/INDEX
    By jslater41 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-08-2014, 01:57 PM
  3. Why a parameter behaves like an array in SUMPRODUCT Function..?
    By Vikas_Gautam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2014, 10:21 AM
  4. How to use SUMPRODUCT or other function to SUM array of values
    By netgroover in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-11-2013, 09:06 PM
  5. Help! Dual Vlookup function? Sumproduct with index array?
    By thaprofessor33 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-03-2012, 09:08 AM
  6. Avoid #Div/0! in Sumproduct
    By bryhogan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-04-2008, 12:26 PM
  7. [SOLVED] Sumproduct + Array Function?
    By Darren Hill in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-08-2005, 09:05 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