+ Reply to Thread
Results 1 to 9 of 9

Find SUM of diagonal entries in a range of values

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    2

    Question Find SUM of diagonal entries in a range of values

    Hello,
    I am using Excel 2016.

    I want to sum all DIAGONAL entries

    Please Login or Register  to view this content.
    My current formula does not work for some reason.
    Please Login or Register  to view this content.
    I would think that this sums the entries from A1 to D4, if the column number is equal to the row number.
    Which should equal 4.

    I would greatly appreciate if anyone could let me know what is wrong with my formula
    and what is/are the correct ways) of doing this.

    Thank you!

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

    Re: Find SUM of diagonal entries in a range of values

    Try array-entering this.

    =SUM(IF(ROW(1:4)=COLUMN(A:D),A1:D4))

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.



    A
    B
    C
    D
    E
    F
    G
    1
    1
    2
    3
    4
    4
    In F1 array-entered
    2
    2
    1
    3
    4
    =SUM(IF(ROW(1:4)=COLUMN(A:D),A1:D4))
    3
    3
    2
    1
    4
    4
    4
    2
    3
    1
    Dave

  3. #3
    Registered User
    Join Date
    05-18-2016
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    2

    Re: Find SUM of diagonal entries in a range of values

    Thank you so much!

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

    Re: Find SUM of diagonal entries in a range of values

    Mathfun,

    You are welcome. Thank you for the feedback and the rep.

    I failed to notice this thread was your first post. My apologies and welcome to the forum.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find SUM of diagonal entries in a range of values

    Here's another one that's a bit more robust.

    Data Range
    C
    D
    E
    F
    5
    26
    0
    89
    68
    6
    95
    97
    91
    85
    7
    5
    92
    99
    24
    8
    16
    87
    35
    87
    9
    ------
    ------
    ------
    ------
    10
    11
    309


    This array formula**:

    =SUM(IF(ROW(C5:F8)-ROW(C5)=COLUMN(C5:F8)-COLUMN(C5),C5:F8))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Find SUM of diagonal entries in a range of values

    And for the other diagonal??

    16, 92, 91, 68

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

    Re: Find SUM of diagonal entries in a range of values

    How about modify Tony's formula

    =SUM(IF((ROW(F8)-ROW(C5:F8))=COLUMN(C5:F8)-COLUMN(C5),C5:F8))

  8. #8
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Find SUM of diagonal entries in a range of values

    Yes, I managed myself. Thank you FlameRetired.

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

    Re: Find SUM of diagonal entries in a range of values

    You are welcome. Thank you for letting us know.

+ 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] Equal Diagonal Values In Excel VBA
    By Excel4444 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-30-2015, 11:57 PM
  2. Extracting Matrix Values *Off*-Diagonal
    By robert.del.carlo in forum Excel General
    Replies: 3
    Last Post: 06-15-2015, 12:12 AM
  3. [SOLVED] find the unique values and new entries from list 1-6
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2013, 02:28 AM
  4. How to find amplitude on diagonal curve?
    By BillBradsky in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 04-04-2013, 10:17 AM
  5. Find a value within a table (horizontal and diagonal)
    By fenfen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-02-2013, 07:16 AM
  6. [SOLVED] Match Column and Row with diagonal values
    By keis386 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-15-2013, 03:37 AM
  7. select only below diagonal from range
    By as_sass in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-27-2005, 03:58 PM

Tags for this Thread

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