+ Reply to Thread
Results 1 to 8 of 8

Summiing every other row with blank cells

  1. #1
    Registered User
    Join Date
    11-07-2016
    Location
    Reno, NV
    MS-Off Ver
    2013
    Posts
    3

    Post Summiing every other row with blank cells

    Hi - I'm trying to add every other cell in a column. I've used code like this before to add every other row:

    {=SUM(B2:B6*(MOD(ROW(B2:B6),2)=1))}

    However, the cells in column B that I'm adding have a formula that will set the cell value to the empty string:

    =IF(A2="","",A2+1)

    If one of the cells being added is empty, I get the error: #VALUE!.

    I thought empty cells would be interpreted as zeros. I've looked around online, but not found a solution. Attached is a sample of the problem. Does anyone have any ideas? BTW, this is a simplification of the formula--I'm not just adding 1 to the value in column A in my real spreadsheet--but this shows the problem.
    Attached Files Attached Files

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Summiing every other row with blank cells

    An easy way using simple formulae is to use a helper column (column C) and enter this formula in c2 and fill down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    To get the sum of every second row starting with the first row enter this where you want the answer
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Another way is to modify your formula in column B to be the following and use Conditional Formatting to hide the zero value(s)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Conditional Formatting rule. Select B2:B6 then go to Conditional Formatting,New,Use Formula enter the following formula and then format the font as white.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by newdoverman; 11-07-2016 at 08:49 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    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: Summiing every other row with blank cells

    Another way, modifying your formula in C8 and array entering it would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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.
    Dave

  4. #4
    Registered User
    Join Date
    11-07-2016
    Location
    Reno, NV
    MS-Off Ver
    2013
    Posts
    3

    Re: Summiing every other row with blank cells

    Thanks for the responses! FlameRetired's looks like it will work for me.

  5. #5
    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: Summiing every other row with blank cells

    Thank you for the feedback.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Summiing every other row with blank cells

    If you are summing B2, B4, B6 the formula given by FlameRetired would have to be slightly modified to the following otherwise you are summing B3 and B5. Again enter with Ctrl+Shift+Enter
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-07-2016
    Location
    Reno, NV
    MS-Off Ver
    2013
    Posts
    3

    Re: Summiing every other row with blank cells

    Thanks newdoverman

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Summiing every other row with blank cells

    Thanks for the feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this 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. Count blank cells in a range and contiguous blank cells also as single cells! Tricky One!
    By SebastianColombia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2015, 02:32 PM
  2. [SOLVED] Macro to fill blank cells in column A based on non-blank cells
    By ktalamantez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 02:47 PM
  3. Ignore blank cells and truly blank cells in named range?
    By hschillig in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-13-2014, 02:56 PM
  4. [SOLVED] Delete special blank cells not recognising blank cells
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-04-2013, 03:54 AM
  5. Replies: 5
    Last Post: 08-26-2013, 06:26 PM
  6. How can I make a macro ignore blank cells? - Blank Cells have formulas
    By mz1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 08:54 AM
  7. Advanced filter with blank cells / Dynamic named range with blank cells
    By Jason_2112 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2010, 12:06 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