Consulting

Results 1 to 4 of 4

Thread: Using concatenate to reference a named range

  1. #1

    Using concatenate to reference a named range

    I am trying to get the sumproduct of two named ranges, by referencing their headers (see below), but using the concatenate/"&" function. However, I keep getting a value error.

    The range on your left (see below) is called "income1" and the one on your right is called "interestA". There are quite a few of these, from 1 to 10, and A to J.

    This works: SUMPRODUCT(income1,InterestA)
    But this doesn't work: SUMPRODUCT("income"&B3,"Interest"&F3). Cell B3 is the header "1" of the income range "income1", and cell F3 is the header "A" of the interest range "InterestA".
    How do I get the latter to work? Example file attached.

    1 A
    1041 0.820863
    2987 0.065637
    6112 0.803949
    1587 0.879469
    6953 0.040989
    5071 0.080362
    8413 0.520205
    4111 0.639688
    4284 0.512224
    2333 0.471039
    2325 0.28264
    Attached Files Attached Files

  2. #2
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    try this:

    =SUMPRODUCT(INDIRECT("income"&B3),INDIRECT("Interest"&F3))

  3. #3
    Awesome. It works. Thanx!

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,057
    Location
    Quote Originally Posted by tatendamark View Post
    Awesome. It works. Thanx!
    So, what stopped you from marking the issue as solved?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •