+ Reply to Thread
Results 1 to 13 of 13

Index Match Formula to Sum a range of values

  1. #1
    Registered User
    Join Date
    02-04-2018
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    8

    Index Match Formula to Sum a range of values

    Dear all,

    Hope to find a solution to this problem.

    I have a long route with points A to F along its entirety.
    The distance from A to B is 41, B to C is 11, so and and so forth.

    The issue:
    I am trying to use Index + Match + Sum to find the total distance between points B and E.
    I am also trying to make the formula flexible so that the points can be changed to find distances between different points easily.

    A B 41
    B C 11
    C D 127
    D E 21
    E F 2

    Would really appreciate help on this issue. Thanks!

  2. #2
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Index Match Formula to Sum a range of values

    Try Point1 in F1, point2 in F2
    Distance is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached workbook
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-04-2018
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    8

    Re: Index Match Formula to Sum a range of values

    Thanks Geoff! Will give it a go.

  4. #4
    Registered User
    Join Date
    02-04-2018
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    8

    Re: Index Match Formula to Sum a range of values

    I was trying to manipulate the formula, but I think because it uses the ROW formula I cannot move the formula around.
    Is there a way around this?

  5. #5
    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,955

    Re: Index Match Formula to Sum a range of values

    Try this...
    A
    B
    C
    D
    E
    F
    1
    Start End Dist
    2
    A B
    41
    Start B
    3
    B C
    11
    End F
    4
    C D
    127
    Dist
    161
    5
    D E
    21
    6
    E F
    2


    F4=SUM(OFFSET(C1,MATCH(F2,$A$2:$A$6,0),0,MATCH(F3,B2:B6,0)-MATCH(F2,$B$2:$B$6,0),1))
    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

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,659

    Re: Index Match Formula to Sum a range of values

    Try this.
    Start=E2
    End=F2
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Index Match Formula to Sum a range of values

    I was trying to manipulate the formula, but I think because it uses the ROW formula I cannot move the formula around.
    Is there a way around this?
    You're spoiled for choice for solutions! If you're still interested in mine then read on.

    I don't think it's row() that was the problem. I tried cutting A1:F5 and pasting elsewhere and that did result in a #N/A error. The problem was a typo at the very end of the formula where $B$1:$B$6 should have been $B$1:$B$5. So the corrected formula is:

    =SUMPRODUCT($C$1:$C$5,--(ROW($1:$5)>=MATCH($F$1,$A$1:$A$5)), --(ROW($1:$5)<=MATCH($F$2, $B$1:$B$5)))

    With this change I was able to cut/paste A1:F5 elsewhere without problems.

    If you're still interested in this solution and still have problems then let me know.
    Last edited by GeoffW283; 01-14-2019 at 12:49 PM.

  8. #8
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Index Match Formula to Sum a range of values

    On further testing, if I select, say, A4:C4 then "Insert" to add an additional point then my formula breaks because of the row() function (although it's OK if you insert an entire row).

    Neither Ford's solution nor kvsrinivasamurthy's have this weakness so you will be better off choosing one of theirs.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,424

    Re: Index Match Formula to Sum a range of values

    And another. A variation on Ford's.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  10. #10
    Registered User
    Join Date
    02-04-2018
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    8

    Re: Index Match Formula to Sum a range of values

    Thanks everyone for all your solutions. Big thanks to Geoff for always coming back to check and help

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,424

    Re: Index Match Formula to Sum a range of values

    You are welcome. Thank you for the feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  12. #12
    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,955

    Re: Index Match Formula to Sum a range of values

    Happy to help

  13. #13
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Index Match Formula to Sum a range of values

    And same from me - 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. [SOLVED] Index match with range of values
    By Brian65 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-18-2018, 06:28 AM
  2. [SOLVED] Index match array of name and values in a range
    By gutterball in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-12-2016, 04:52 PM
  3. Index match then returning a range of date values
    By jenniesmith in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-04-2015, 01:07 PM
  4. Index, Match to a range of values < >
    By overbomb in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2015, 09:51 AM
  5. Formula to Index, Match, Rank, and Sort a Dynamic Range of Values
    By AustinLe in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-14-2014, 03:49 AM
  6. [SOLVED] INDEX MATCH - Selecting lowest value in a range of values
    By indyrob in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-23-2013, 04:36 AM
  7. VBA - Index double match and insert values in range
    By Biinge in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-02-2011, 02:43 PM

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