+ Reply to Thread
Results 1 to 7 of 7

Counting blank cells up to first non-blank cell

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    1

    Counting blank cells up to first non-blank cell

    What formula/function would let me count blank cells up a column until it reaches a non-blank cell. The column contains cells that are either blank or contain numbers. I would like the formula to count blank cells until it reaches the first cell containing numbers.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Counting blank cells up to first non-blank cell

    You didn't give a range, so I'll assume you mean from the very bottom and I'll use Column A.

    =COUNTBLANK(INDIRECT(CELL("address",INDEX(A1:A1048576,MATCH(2,INDEX(1/(1-ISBLANK(A1:A1048576)),0))))&":A1048576"))

    Let's confidently assert some more:

    Your last cell has data in A12. The count of blank cells between A12 and A1048576 is 1048564.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Counting blank cells up to first non-blank cell

    Pl see attached file
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-21-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Counting blank cells up to first non-blank cell

    Hi kvsrinivasamurthy,

    Based on your formula, if I wanted to count the roll instead of column, do I change the "COLUMN" in your formula to "ROLL"?

    Thanks,
    Josh

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Counting blank cells up to first non-blank cell

    Hi Josh, welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    02-17-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Counting blank cells up to first non-blank cell

    I found an excel file here in which the given formula is working for column, I want this for ROW, please help
    Regards,

    Kamran
    PAKISTAN.
    Excel - 2007

  7. #7
    Registered User
    Join Date
    02-17-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Counting blank cells up to first non-blank cell

    This is the formula

    =IFERROR(IF(D1<>"",LARGE(IF($C$1:C1="",COLUMN($C$1:C1),""),1)-LARGE(IF($C$1:C1<>"",COLUMN($C$1:C1),""),1),""),"")

    and I wana adjust in A:A

+ 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. Replies: 2
    Last Post: 11-22-2013, 01:07 PM
  2. Counting number of non-blank cells for every nth cell
    By mqp92 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-03-2013, 11:08 AM
  3. Replies: 8
    Last Post: 01-28-2013, 01:10 AM
  4. Find a blank cell and calculate the average of all cells above till the next blank
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 11:51 AM
  5. Replies: 0
    Last Post: 08-23-2005, 03:43 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