+ Reply to Thread
Results 1 to 5 of 5

Count number of empty columns in a row since non-empty column

  1. #1
    Registered User
    Join Date
    05-14-2018
    Location
    new york, ny
    MS-Off Ver
    excel 2016
    Posts
    2

    Count number of empty columns in a row since non-empty column

    Hello everyone,

    I am trying to figure this out a formula in order to count the number of empty columns in a row since a non-empty column.

    The idea is to get a number of inactive months since the last entry. I have included an excel showing what I am trying to achieve.

    I have tried using some of the formulas that I have found in this forum and in other places with no luck.

    Any help is greatly appreciated.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Count number of empty columns in a row since non-empty column

    In T2:
    =COLUMNS(B2:R2)-MAX(IF(B2:R2<>"",COLUMN(B2:R2)-1))

    Confirmed as array (CTRL + SHIFT + ENTER) Copy down.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Count number of empty columns in a row since non-empty column

    Here's a non-array alternative:

    T2 =COUNTA(B$1:R$1)-IFNA(LOOKUP(2,1/(B2:R2<>""),COLUMN(B2:R2))-1,0)

  4. #4
    Registered User
    Join Date
    05-14-2018
    Location
    new york, ny
    MS-Off Ver
    excel 2016
    Posts
    2

    Re: Count number of empty columns in a row since non-empty column

    I really apprecite both of your answers. For some reason, the first one didnt work for me but the second one worked well. Much appreciated!

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Count number of empty columns in a row since non-empty column

    You're welcome. Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. [SOLVED] Count number of empty cells and sum up too the first non-empty cell.
    By CraftyGamer in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-28-2017, 11:35 AM
  2. [SOLVED] How to create a dynamic range if the last cell is empty and the columns have empty cells
    By peter_swe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2016, 11:18 PM
  3. Replies: 0
    Last Post: 08-03-2016, 07:01 PM
  4. [SOLVED] Loop That Will Count Number Of Comments In a Column Between Empty Cells
    By M7A0S8T8E5R in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2016, 04:32 PM
  5. Replies: 10
    Last Post: 09-26-2015, 08:26 PM
  6. [SOLVED] 8 Columns with empty cells -> 1 Column without empty cells -> Problem: 1st value ignored
    By chrisignm in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-23-2015, 04:50 AM
  7. [SOLVED] Count number of non-empty columns in a multi-row range
    By amandanewt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2014, 01:30 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