+ Reply to Thread
Results 1 to 32 of 32

exclude TOTAL row and sum TOTAL column based on sheet name

  1. #1
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    exclude TOTAL row and sum TOTAL column based on sheet name

    Hello
    I want summing amount for the whole column (TOTAL) for each sheet and exclude TOTAL row from summing until doesn't sum twice for the same values have ever summed in TOTAL row .
    so I want to create the whole report as in REPORT sheet , but should brings the balances from ASD sheet before sum the whole every sheet .
    when merge the whole column TOTAL should be for each sheet name as in column B(like FIRST SALES+SALES, FIRST BUYING+BUYING.....and so on) .populate TOTAL FIRST SALES =100,000 from ASD sheet and sum TOTAL column for SALES sheet=1210+462+440+220+330=2662
    and show TOTAL row for each sheet as in column A (SALES TOTAL ,PURCHASE TOTAL,.... and so on) with auto serial

    and should calculation as in lastrow (NET)
    last thing the TOTAL column will be changed in location in others sheets as you note it .
    and should clear data for REPORT sheet when run the macro every time .
    thanks
    Attached Files Attached Files
    Last edited by KalilMe; 06-18-2023 at 06:15 AM.

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    For sheet SALES and BUYING, please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and so on

  3. #3
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2504 and WPS V2024(12.1.0.18543)
    Posts
    4,037

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    worksheet or Tab name : REPORT

    Cell C4 formula , Then copy this to the blue cell
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    I think misunderstood guys
    should sum the whole TOTAL column for each sheet
    populate TOTAL FIRST SALES =100,000 from ASD sheet and sum TOTAL column for SALES sheet=1210+462+440+220+330=2662

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2504 and WPS V2024(12.1.0.18543)
    Posts
    4,037

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Hi KalilMe

    From the attachment you provided, I can only see all the worksheet names SALES, BUYING, EXPENSES, RECEIVED, ASD. Summarize all relevant information to the worksheet name REPORT, not to the worksheet name ASD as you said
    I don’t know if this is the right understanding? Please explain the requirements

    worksheet or Tab name : REPORT

    Cell C2 formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Cell C3 formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Cell C4 formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    COPY THIS RANGES C2:C4 , place to cell C5,C8 and C11
    Last edited by wk9128; 06-18-2023 at 07:17 AM.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Please put your expected results in your sheet.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: exclude TOTAL row and sum TOTAL column based on sheet name


    Hi,

    as a VBA procedure is useless just using formulas like in post #2 …

  8. #8
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Please put your expected results in your sheet.
    I gave you in OP and inside the sheet .
    so I want to create the whole report as in REPORT sheet
    example
    when merge the whole column TOTAL should be for each sheet name as in column B(like FIRST SALES+SALES, FIRST BUYING+BUYING.....and so on) .populate TOTAL FIRST SALES =100,000 from ASD sheet and sum TOTAL column for SALES sheet=1210+462+440+220+330=2662

  9. #9
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    not to the worksheet name ASD as you said
    just match C2 with in ASD sheet with C2 in REPORT sheet .
    I will check your formulas.

  10. #10
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    as a VBA procedure is useless just using formulas like in post #2 …
    thanks for your advice , not really sure formula or vba .just I posted here.
    Last edited by KalilMe; 06-19-2023 at 06:01 AM.

  11. #11
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: exclude TOTAL row and sum TOTAL column based on sheet name


    A VBA procedure seems superfluous, why over complicating instead of using beginner level worksheets formulas ?‼

    Just remove rows indexes like according to post #2 =SUM(J:J)/2

  12. #12
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    @wk9128
    may check C3
    as I said
    and exclude TOTAL row from summing until doesn't sum twice for the same values have ever summed in TOTAL row .
    so either summing just for last row(TOTAL) and exclude the others values in TOTAL column or exclude last row(TOTAL) and summing the others in TOTAL column . but your formula sums whole values in TOTAL column without exceptions .

  13. #13
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: exclude TOTAL row and sum TOTAL column based on sheet name


    That's 'cause of your bad TOTAL formulas design ! The reason why the sum must be divided by 2 …

    As a smart worksheet must use the SUBTOTAL worksheet function for each intermediate total.

  14. #14
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    That's 'cause of your bad TOTAL formulas design !
    there is no formula in my data!

  15. #15
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: exclude TOTAL row and sum TOTAL column based on sheet name


    So can you delete each total row in data worksheets or use a SUBTOTAL formula ?
    Last edited by Marc L; 06-19-2023 at 11:28 AM.

  16. #16
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    So can you delete each total row in data worksheets or use a SUBTOTAL formula ?
    surely not !
    this way create by macro .

  17. #17
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: exclude TOTAL row and sum TOTAL column based on sheet name


    Such a bad code not respecting Excel rules !
    And why this code does not create directly the worksheet REPORT ?!


    So two ways without needing to create another VBA procedure, one smart and one dumb.

    The smart needs to have TOTAL rows in data worksheets using the Excel worksheet function SUBTOTAL
    in order the formulas to be added to worksheet REPORT works forever just using the same function according to Excel design
    so you have to modify the original VBA procedure …

    If for some dark reason the sources worksheets must stay as poor as they actually are
    then the dumb way is to use the worksheet function SUMIF but may fail in some cases …

    So what's your choice ?

  18. #18
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    And why this code does not create directly the worksheet REPORT ?!
    the ideas don't coming at one time.
    The smart needs to have TOTAL rows in data worksheets using the Excel worksheet function SUBTOTAL
    in order the formulas to be added to worksheet REPORT works forever just using the same function according to Excel design
    so you have to modify the original VBA procedure
    this is better choice .
    but need more work and need write the code from scratch then

  20. #20
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Hi jindon
    I will check your code and comeback to inform you how goes.

  21. #21
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    thanks jindon for your code .
    works as I want it .

  22. #22
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Hi Jindon
    sorry I came back
    I no know if you can help .
    I need get rid of error subscript out of range in this line
    Please Login or Register  to view this content.
    I have two cases
    1- if I don't have balance in ASD sheet then should consider the value is zero even if there is no account name in column B
    example :
    if I have sheet name is STOCK and the TOTAL column =10000 before ASD sheet and There is no equivalent in the ASD sheet
    then will show in REPORT sheet like this
    in column B =stock and column C =10000 and under it in column A=STOCK TOTAL , column C=10000
    2- if there is balance in ASD sheet in column B= FIRST STOCK ,column C=2000 and there is no equivalent in before ASD sheet
    then will show in REPORT sheet like this
    column B =FIRST STOCK ,c=2000 and under it in column A=FIRST STOCK TOTAL , column C=2000 .
    what I mean sometimes what is existed in ASD sheet couldn't be equivalent in before ASD sheet and what is existed in before ASD sheet couldn't be equivalent in ASD sheet.
    thanks

  23. #23
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Hi jindon
    I'm still need your help to adapt this project
    so if I don't have any balance in ASD for the existed sheet then should show as in row 11,12 for report sheet for RECEIVED sheet not existed the balance in ASD sheet, and if there is balance in ASD sheet but there is no sheet name is matched with the balance in ASD sheet then should show in report sheet as in rows 13,14.
    thanks
    Attached Files Attached Files

  24. #24
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Is this the last change?
    If not, reveal everything in one workbook.

  25. #25
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Is this the last change?
    If not, reveal everything in one workbook.
    ok I will post new file soon.

  26. #26
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    the first case as I explain in post #23
    the second case if I select the year then should sum for just is relating with year as I posted in YEARLY sheet when select year from F1 but should be in REPORT sheet. as to first balance from SD should show in all of about if select year or not.
    Attached Files Attached Files

  27. #27
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    try the atached.
    when F1 = "", all years.
    Attached Files Attached Files

  28. #28
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    it's perfect !
    but I would show the first balance from ASD sheet for already existed sheets when select the year or not .
    should ignore year from ASD sheet whether select year or not as I said
    as to first balance from SD should show in all of about if select year or not

  29. #29
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    No idea about what you are trying to say.
    It is working as you showed in the sample workbook.

    Upload a workbook with your desired result.

  30. #30
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    I highlighted rows should show when select 2024 year.
    should ignore year from ASD sheet when brings first balances when select any year.
    always should show first balances regardless what's the year.
    Attached Files Attached Files

  31. #31
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    1) change in "test" sub procedure.
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    2) replace "GetList" sub procedure with
    Please Login or Register  to view this content.

  32. #32
    Forum Contributor
    Join Date
    04-11-2021
    Location
    Tripoli
    MS-Off Ver
    Excel 2016 ,windows 10 64bit
    Posts
    409

    Re: exclude TOTAL row and sum TOTAL column based on sheet name

    Great!
    many thanks for adjusting.

+ 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. 2 workbooks, Find values in sheet, total them up, move total to other book?
    By excelgirl84 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-13-2022, 06:31 AM
  2. [SOLVED] Exclude a column from Grand Total in Pivot?
    By NewYears1978 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 08-23-2022, 07:22 AM
  3. [SOLVED] Exclude Column from Total Sum
    By ratcat in forum Access Tables & Databases
    Replies: 0
    Last Post: 03-14-2019, 04:51 AM
  4. how to work out rate based on total time and total amount
    By lisaathers in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-09-2013, 06:44 AM
  5. Pivot Table - Exclude Column Figures from Grand Total
    By larzep in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-29-2013, 03:50 AM
  6. Replies: 4
    Last Post: 07-28-2012, 10:32 AM
  7. [SOLVED] Calculate total of a column, based on criteria and copy to another sheet
    By luke.guthrie in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 06-01-2012, 05:59 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