Results 1 to 3 of 3

Thread: Sum between rows

  1. #1
    Board Regular
    Join Date
    Jun 2018
    Posts
    95
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Sum between rows

    Hi community,

    I want to know how can i calculate numbers between specific rows? if user selects January from data validation list i want excel to calculate numbers from January to august, if May than from May to August. btw user can select start and end date. so it can be from january to may etc.

    Month names are in A1:A12
    and numbers are in B1:B12

    Can anybody help me to solve this problem please?

  2. #2
    MrExcel MVP AlphaFrog's Avatar
    Join Date
    Sep 2009
    Posts
    16,087
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    7 Thread(s)

    Default Re: Sum between rows

    If the Data Validation lists are in C1 and C2

    =SUM(OFFSET(B1,MATCH(C1,A1:A12,0)-1,,MATCH(C2,A1:A12,0)-MATCH(C1,A1:A12,0)+1))
    Paste your Excel data to the forum...
    MrExcel HTML Maker or Excel Jeanie

    How to post your vba code
    [CODE]your VBA code here[/CODE]
    The # button in the forum's editor will apply CODE tags around your selected text.

  3. #3
    Board Regular
    Join Date
    May 2015
    Location
    Kolkata, India
    Posts
    506
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Sum between rows

    You can try this:

    ABCDEF
    1Jan100Start DateEnd DateSum
    2Feb1002-02-201906-07-2019270
    3Mar30
    4Apr90Start MonthEnd MonthSum
    5May40FebJul270
    6Jun50
    7Jul50
    8Aug90
    9Sep40
    10Oct30
    11Nov40
    12Dec70
    13

    Sheet3



    Worksheet Formulas
    CellFormula
    F2=SUM(INDEX(B1:B12,MATCH(TEXT(D2,"mmm"),A1:A12,0)):INDEX(B1:B12,MATCH(TEXT(E2,"mmm"),A1:A12,0)))
    F5=SUM(INDEX(B1:B12,MATCH(D5,A1:A12,0)):INDEX(B1:B12,MATCH(E5,A1:A12,0)))

    Regards,
    Nishant Ghosh

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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