+ Reply to Thread
Results 1 to 6 of 6

Sum of different lines

  1. #1
    Forum Contributor
    Join Date
    08-22-2012
    Location
    Czech republic
    MS-Off Ver
    Excel 2010
    Posts
    119

    Sum of different lines

    Dear all,
    after some days not using excel so often my brain hurts trying to remember a solution I created long time ago (and my flash disk is not available for me this month).
    I need to summarize YTD number of monthly movement on account listed on more sheets.
    more in detail: I need excel make a sum (starting at cell which has same name as in A column on sheet in B column. I need it makes a summation of not all, but just YTD months (=here:offset (0, reported month).

    Please give me a hint or a solution and save it in excel as well (I am not using english excel, but saving in file make all needed translation.)

    Thank you very much.

    Other way: See formulas I created. Make them more automatic. Thanks

    Petr
    Attached Files Attached Files

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Sum of different lines

    I don't know is there a simplier way...

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by zbor; 10-25-2013 at 06:18 AM. Reason: Attachment added

  3. #3
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Sum of different lines

    A1 = "Account"
    A2 = 10101
    //User input: the account number


    B1 = Sheet
    B2 = IF(ISERROR(MATCH(A2,A!A1:A100,0)), IF(ISERROR(MATCH(A2,B!A1:A100,0)),#N/A,"B"),"A")
    //IF: the Account Number is on sheet A and says "A" if it is;
    //ELSE: the Account Number is on sheet B and says "B" if it is;
    //ELSE: returns an error if neither of the above is true.

    C1 = "Row"
    C2 = MATCH(A2,INDIRECT(List1!B2&"!A1:A100"),0)
    //Returns the row number on the sheet for the account number.


    D1 = "Month"
    D2 = 9
    // User input

    E1 = "SUM"
    E2 = SUMIF(INDIRECT(B2&"!C2:N2"),"<="&List1!$D2,INDIRECT(B2&"!"&"C"&C2&":L"&C2))
    //Takes the SUM of all values in the account row IF the number on the header row is less than or equal to the user input of month.

    General note: If your A and B sheets aren't set up exactly the same as each other, AND the same as the example, then this is going to either explode into confusion and errors, or merely lie to you. So you might have to adjust your formulas.
    Last edited by ben_hensel; 10-25-2013 at 06:16 AM.

  4. #4
    Forum Contributor
    Join Date
    08-22-2012
    Location
    Czech republic
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Sum of different lines

    Please, please, paste it in the excel as I wrote. Thanks a lot.

  5. #5
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Sum of different lines

    Quote Originally Posted by olwy View Post
    Please, please, paste it in the excel as I wrote. Thanks a lot.
    ...you can't do this yourself?

    w/e
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-22-2012
    Location
    Czech republic
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Sum of different lines

    Thank you very much. As I wrote before, I am not using english version of excel and there is a different syntaxt of some function. So, if I only translate it to my language, it does not works. If you save it and I open it - it works very well with no problem. That is the reason for. Again - thanks.
    Your solution is working nicely for my needs. Have a nice weekend.

+ 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. macro to autofilter and copy first 15 lines visible lines in columns D:E
    By Juraj123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2013, 03:40 AM
  2. [SOLVED] Insert blank lines to make the total number of lines 67
    By raghuprabhu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 07:34 AM
  3. [SOLVED] Macro to Delete useless lines, rearrange by dates and skip lines between different days.
    By Tmc2159 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-12-2012, 02:15 PM
  4. Replies: 0
    Last Post: 02-09-2012, 11:53 AM
  5. [SOLVED] Inserting Lines or Copying lines with formulas but without data
    By wnfisba in forum Excel General
    Replies: 2
    Last Post: 08-18-2006, 11:41 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