+ Reply to Thread
Results 1 to 11 of 11

Cell formula to select values of first blank cell in a row and then the next four cells

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    East Coast USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Post Cell formula to select values of first blank cell in a row and then the next four cells

    Hi,

    I am need a formula in the cell BG (no array formula please) that searches through the current row starting from column G through BF for the first BLANK cell and returns the total values from the cell to the right of Blank cell and the next 3 cells to the right of it)

    For example: M4 is the first blank cell in row 4, then I need to get the total of (L4 through I4) which would be 13.
    G4=5
    H4=2
    I4=3
    J4=1
    K4=4
    L4=5
    M4=BLANK
    N4:BF4=BLANKS

    Thanks in advance for any help.

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

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Maybe this...

    =SUM(BF4:INDEX(G4:BF4,MATCH(1E100,G4:BF4)-3))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-13-2012
    Location
    East Coast USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Hi Tony,

    Thanks, but this formula didn't work. By the way, what is the "1E100" meant to do in your formula?

  4. #4
    Registered User
    Join Date
    09-13-2012
    Location
    East Coast USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Tony,

    My bad! Your formula is partially working. in the following case, the formula didn't work. The sum should have return 7, but is returing VALUE error. The formula needs to sum any non-blanks in the range of G4:BF4 for example.

    G4=5
    H4=2
    I4:BF4=BLANKS

  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: Cell formula to select values of first blank cell in a row and then the next four cell

    Please restate what you want to do.

    In the 1st post in the 1st paragraph you say:

    from the cell to the right of Blank cell and the next 3 cells to the right of it
    But in the next paragraph you show and describe an example that goes to the left.

    Do you want to sum the 4 right-most numbers in the range of cells?

    Are the numbers entered in a contiguous range?

  6. #6
    Registered User
    Join Date
    09-13-2012
    Location
    East Coast USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Tony,

    Sorry if I was not clear. Still we need the sum result from the four left cells next to a blank cell. Range (G4:BF4) will always have numeric values. At times, a row may only have 1 or 2 non-blanks starting from column G. So the sum needs to account for it and calculate result based on that. If a row has non-blank values from column G through L, then the sum needs to get the values from columns (I through L). Please let me know if I am still not clear and thanks for your help.
    Last edited by labkhand; 07-08-2013 at 10:04 AM.

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

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Can you post a SMALL sample file (10 to 15 rows worth of data will do) and show us what result you expect for each row?

  8. #8
    Registered User
    Join Date
    09-13-2012
    Location
    East Coast USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Tony,

    Attached is the sample file with the "SUM" column showing needing results.
    Attached Files Attached Files
    Last edited by labkhand; 07-08-2013 at 12:19 PM.

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

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Try this...

    Assuming there will always be at least 1 number on a row...

    Enter this formula entered in BG3 and copied down:

    =SUM(BF3:INDEX(G3:BF3,MATCH(1E100,G3:BF3)-MIN(3,COUNT(G3:BF3))))

  10. #10
    Registered User
    Join Date
    09-13-2012
    Location
    East Coast USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    Perfect! Thanks very much!
    Last edited by labkhand; 07-08-2013 at 12:29 PM.

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

    Re: Cell formula to select values of first blank cell in a row and then the next four cell

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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