+ Reply to Thread
Results 1 to 15 of 15

sum of even cells & odd cells in a column

  1. #1
    Registered User
    Join Date
    05-08-2016
    Location
    dam
    MS-Off Ver
    2010,2013,2016
    Posts
    8

    sum of even cells & odd cells in a column

    Hi All;
    Need formula or macro to make sum for even cells (b(x),b(x+2),B(X+3)......
    And sum for odd cells
    Thanks

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: sum of even cells & odd cells in a column

    Is this what you meant?? If data are in A1 to a6:

    even rows
    =SUM(IF(MOD(ROW($A$1:$A$6),2)=0,$A$1:$A$6,0))

    odd rows
    =SUM(IF(MOD(ROW($A$1:$A$6),2)=1,$A$1:$A$6,0))

    Both are array formulae. Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: sum of even cells & odd cells in a column

    May be
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  4. #4
    Registered User
    Join Date
    05-08-2016
    Location
    dam
    MS-Off Ver
    2010,2013,2016
    Posts
    8

    Re: sum of even cells & odd cells in a column

    Grate thanks alot

  5. #5
    Registered User
    Join Date
    05-08-2016
    Location
    dam
    MS-Off Ver
    2010,2013,2016
    Posts
    8

    Re: sum of even cells & odd cells in a column

    Hi Mr yaser
    please see the attached
    something wrong ?
    regards

  6. #6
    Registered User
    Join Date
    05-08-2016
    Location
    dam
    MS-Off Ver
    2010,2013,2016
    Posts
    8

    Re: sum of even cells & odd cells in a column

    Hi Mr yaser
    Last edited by mohadink; 09-28-2016 at 06:10 AM.

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: sum of even cells & odd cells in a column

    Hello Mohadin
    What attachment do you mean? I didn't attach any files
    Do you mean the attachment in Post # 2?

  8. #8
    Registered User
    Join Date
    05-08-2016
    Location
    dam
    MS-Off Ver
    2010,2013,2016
    Posts
    8

    Re: sum of even cells & odd cells in a column

    yes I did applied your UDF
    It gave wrong results

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: sum of even cells & odd cells in a column

    Mohadink. Who are you talking to?

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: sum of even cells & odd cells in a column

    If you mean the odd and even numbers themselves so use my solution
    If you mean the odd and even numbers for the rows regardless the values use Mr. Glenn's solution

  11. #11
    Registered User
    Join Date
    05-08-2016
    Location
    dam
    MS-Off Ver
    2010,2013,2016
    Posts
    8

    Re: sum of even cells & odd cells in a column

    Hi Glenn ...
    your formulas are ok
    thanks for your help,
    the issue is the yaser's UDF is not working allright
    sorry for miss understanding
    regards

  12. #12
    Registered User
    Join Date
    05-08-2016
    Location
    dam
    MS-Off Ver
    2010,2013,2016
    Posts
    8

    Re: sum of even cells & odd cells in a column

    ok
    so its Mr. Glenn"s
    thank you

  13. #13
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: sum of even cells & odd cells in a column

    You're welcome
    Please mark the thread as solved

    You can edit both udfs in this line
    Please Login or Register  to view this content.
    Replace 'Value' with 'Row'

    Regards

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: sum of even cells & odd cells in a column

    Double post...
    Last edited by Glenn Kennedy; 09-28-2016 at 07:24 AM.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: sum of even cells & odd cells in a column

    Glad to have helped you.

+ 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. vba code to filter blank cells in a column only if the column has blanks cells
    By meus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2016, 07:05 AM
  2. [SOLVED] Simple Question: Dividing The Cells In Column C by the the Cells in Column B
    By blickers in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-03-2015, 05:18 PM
  3. Replies: 2
    Last Post: 04-17-2014, 03:30 PM
  4. [SOLVED] Auto populate cells in one column based if cells in next column are populated
    By diablo86 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-22-2013, 06:29 AM
  5. Comparing cells in a column and adding result of comparison in cells of adjacent column
    By Lionel welshboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 05:37 AM
  6. Merge cells in a column based on cells highlighted in other column
    By nileshrg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-27-2011, 03:22 AM
  7. [SOLVED] copy a column of single cells into a column of merged cells
    By clairejane_99@hotmail.com in forum Excel General
    Replies: 3
    Last Post: 08-17-2006, 09:30 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