+ Reply to Thread
Results 1 to 8 of 8

How to sum the first four cells is a row starting with the first non-blank cell?

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    Phils
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    46

    How to sum the first four cells is a row starting with the first non-blank cell?

    I hope this is possible with a formula to avoid VBA. My data / table of values are in J to X. I want to get the sum of the 4 cells starting with the first non-blank cell. I believe a picture can describe the problem better.

    excel-row-summation.png

    I hope the image is attached at the top.
    The goal is for Excel to identify the first non-blank cell, then sum the 4 rows starting with the non-blank cells regardless if the next 3 cells are blanks or not. I have search the forum and Google and most of the formulas are adding non-blank cells in a row.

    I hope you can help.

    Thank you.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: How to sum the first four cells is a row starting with the first non-blank cell?

    Try:
    =IFERROR(SUM(OFFSET(J2,,,,MATCH(TRUE,J2:X2>0,0)+3)),0)
    ...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 your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Quang PT

  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: How to sum the first four cells is a row starting with the first non-blank cell?

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

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

    Re: How to sum the first four cells is a row starting with the first non-blank cell?

    Many members are unable to see images in the *.png format due to forum compatibility issues with some browsers.

    If you need to post an image post it in the *.jpg format.

    Even better than posting images... post a SMALL sample file. That way we can test solutions directly in the file with the relevant data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: How to sum the first four cells is a row starting with the first non-blank cell?

    I posted a response in your VBA thread that works...

    http://www.excelforum.com/excel-prog...ml#post4316337

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

  6. #6
    Registered User
    Join Date
    04-25-2013
    Location
    Phils
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    46

    Re: How to sum the first four cells is a row starting with the first non-blank cell?

    Quote Originally Posted by bebo021999 View Post
    Try:
    =IFERROR(SUM(OFFSET(J2,,,,MATCH(TRUE,J2:X2>0,0)+3)),0)
    ...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 your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Hi, thank you very much for your reply. I tried your array formula and it works perfectly when there are 4 or more cells in a row to SUM. But when there are less than 4, the result is incorrect.
    For instance, if the first non-blank cell is in W, it means only 2 cells to SUM -- W and X. The result shown is incorrect.

  7. #7
    Registered User
    Join Date
    04-25-2013
    Location
    Phils
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    46

    Re: How to sum the first four cells is a row starting with the first non-blank cell?

    Quote Originally Posted by dosydos View Post
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you!!!! This formula is working!!!

  8. #8
    Registered User
    Join Date
    04-25-2013
    Location
    Phils
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    46

    Re: How to sum the first four cells is a row starting with the first non-blank cell?

    Quote Originally Posted by cantosh View Post
    I posted a response in your VBA thread that works...

    http://www.excelforum.com/excel-prog...ml#post4316337

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you!!! This is also working!!!!

+ 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. Enter Data from userform into cells starting from specific cell
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2014, 04:26 PM
  2. [SOLVED] Find First blank cell starting from the top
    By mturnertombow in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 12-16-2013, 09:11 AM
  3. [SOLVED] Count cells starting from blank and reset after another blank
    By slasherdan in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-07-2013, 03:46 AM
  4. Count 52 Cells Starting From First Non Blank Cell In Range
    By Caedmonball19 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 08-20-2013, 12:23 PM
  5. Since when does AdvancedFilter not work if a starting cell is blank?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2013, 08:27 PM
  6. [SOLVED] Copy or Move rows starting with a particular cell value until next blank row
    By sborda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2012, 07:53 AM
  7. Replies: 4
    Last Post: 07-05-2012, 12:05 PM
  8. look for blank cell Above starting cell instead of below
    By stuartglass in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 12-21-2010, 07:25 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