+ Reply to Thread
Results 1 to 4 of 4

VBA / User Defined Function for an Antiparallel SUMPRODUCT

  1. #1
    Registered User
    Join Date
    09-18-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA / User Defined Function for an Antiparallel SUMPRODUCT

    I had something like this built years ago, but now I need it again and don't have the original code
    Function has two range variables: rng1 and rng2
    Function output is the sum of the 1st value in rng1 times the last value in rng2, through to the last value in rng1 times the first value in rng2.
    E.g. If the ranges had 1,2,3 and 4,5,6 respectively then the calculation would be 1*6 + 2*5 + 3*4 and the output would be 28. Note: Normal SUMPRODUCT function would give 1*4+2*5+3*6=32
    I should confirm both ranges have the same length, and I should be able to use a For Each cell in..., but I'm not seeing how to reference the opposing cell in rng2.
    Any suggestions welcomed.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: VBA / User Defined Function for an Antiparallel SUMPRODUCT

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-18-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA / User Defined Function for an Antiparallel SUMPRODUCT

    Thank you Norie!
    With a little tweak or two it is working great!
    Please Login or Register  to view this content.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: VBA / User Defined Function for an Antiparallel SUMPRODUCT

    Try :-
    Please Login or Register  to view this content.

+ 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] User defined function returns an error on a standard function used in it.
    By pb48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 01:35 PM
  2. User Defined Function - Sumproduct
    By PeterW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-23-2008, 09:20 PM
  3. User Defined Function
    By PeterW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2007, 12:20 AM
  4. Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM
  5. [SOLVED] Need to open the Function Arguments window from VBA for a user defined function.
    By korrin.anderson@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2006, 10: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