+ Reply to Thread
Results 1 to 10 of 10

How to sum non-contiguous columns applied as a formula on contiguous cells

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Cool How to sum non-contiguous columns applied as a formula on contiguous cells

    Hello people:

    I have the following scenario:

    I would like to sum Sheet#1īs "Rec" "Ans" and "Aband" columns for each day ( October 7th,8th, etc) on Sheet #2, but Sheet #1īs columns are non-contiguous for the categories just described:

    I am attaching an excel file as an example.


    Thanks very much!!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    Hello
    In cell C2 copied across and down to cell ND4 on sheet2:

    Please Login or Register  to view this content.
    'Data' is a named range = B3:APG15 on Sheet1.

    'Dates' is a named range = B1:APE1 on Sheet1.

    I've done this for ease of reference but you could just reference the ranges. There are however, some date discrepancies with the years on the two sheets, so it's returning some #N/A errors. For example the date 28/5 on Sheet1 is 2012 but on Sheet2 it's 2014.

    Hope this helps.
    DBY

  3. #3
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    Thanks mate, I entered your formula on Sheet 2īs C2 cell but it returns #NAME? error, is there something that maybe I am missing? Sorry I am not that skilled on Excel!

    Thanks DBY!

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    Have you named the ranges as required ? If not replace the names with the ranges

  5. #5
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    Quote Originally Posted by Pepe Le Mokko View Post
    Have you named the ranges as required ? If not replace the names with the ranges
    Thanks mate, well that is the part that I am missing, how can I name the ranges on sheet #1? I thought that ranges were already named by DBY on the formula.

    Thanks!

  6. #6
    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,938

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    Hi and welcome to the forum

    Try this, copied down and across...
    =SUM(OFFSET(Sheet1!$B$1,2,MATCH(Sheet2!C$1,Sheet1!$B$1:$APG$1,0)+ROW(A1)-2,COUNT(Sheet1!$A:$A),1))

    However, I would suggest that you swing your table around so that your dates go downwards instead of cross. Its always better to grow a table downwards rather than across
    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

  7. #7
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    Quote Originally Posted by FDibbins View Post
    Hi and welcome to the forum

    Try this, copied down and across...
    =SUM(OFFSET(Sheet1!$B$1,2,MATCH(Sheet2!C$1,Sheet1!$B$1:$APG$1,0)+ROW(A1)-2,COUNT(Sheet1!$A:$A),1))

    However, I would suggest that you swing your table around so that your dates go downwards instead of cross. Its always better to grow a table downwards rather than across
    Thanks FDibbins !! It worked!!! Thanks for your advice on dates direction as well!

    Thanks as well to DBY and Pepe Le Mokko!

  8. #8
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    If using my suggestion, select the range of cell as I've noted above and in the Name Box to the left of the Formula Bar Type in your name and press enter. Or just directly reference the ranges without the names.

    DBY

  9. #9
    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,938

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

  10. #10
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: How to sum non-contiguous columns applied as a formula on contiguous cells

    Quote Originally Posted by DBY View Post
    If using my suggestion, select the range of cell as I've noted above and in the Name Box to the left of the Formula Bar Type in your name and press enter. Or just directly reference the ranges without the names.

    DBY
    Thanks mate!!

    FDibbins I will mark thread as solved thanks!!

+ 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. average formula for non contiguous range and eliminate blank cells
    By kkotter in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-28-2013, 10:13 AM
  2. [SOLVED] How to delete multiple contiguous (and/or) non-contiguous rows, in an excel table
    By jimmalk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-03-2012, 05:48 AM
  3. Replies: 2
    Last Post: 11-04-2012, 12:18 AM
  4. Copy and Paste an array (contiguous & non contiguous ranges)
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2010, 09:17 AM
  5. [SOLVED] Copying non-contiguous columns to contiguous columns
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2006, 10:54 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