Forum Discussion
Count number of blank cells till last non empty cell in a column.
- Mar 19, 2018It does not work because of circular reference problem.
My formula range starts from A1 while you also want to use inside the same range.
To make this work you need to redefjne the starting row of your column A in the formula for example if your start of data starts from A4 then the modified formula should be
=COUNTBLANK(A$4:INDEX(A:A,SUMPRODUCT(MAX((A:A<>"")*ROW(A:A)))))
This should work.
Thank you Haytham, I had tried below formula earlier, and that is the issue which I had mentioned in my previous usage of INDIRECT function that column names are fixed and no longer remains dynamic.
Like in below example column A that is "A1:A" is fixed in this formula under the INDIRECT function. Although this formula works perfectly Ok for column A, but if I want to paste this formula for many other columns then I have to manually change this input under the quotes for every column and that is where I have an issue with this formula, it no longer remains dynamic and does not change column reference when pasting in other columns, if you can guide me on how to resolve this issue, then it perfectly solves my issue :) and I will be very happy to learn this :)
=COUNTBLANK(INDIRECT("A1:A"&SUMPRODUCT(MAX((A1:A6000<>"")*ROW(A1:A6000)))))
you can use my formula and then when you drag it to the left, it will also change the reference, as the formula uses relative references.
=COUNTBLANK(A$1:INDEX(A:A,SUMPRODUCT(MAX((A:A<>"")*ROW(A:A)))))
- Saurabh KhannaMar 19, 2018Copper Contributor
Hello Mohammad -
I agree with you, your formula gives the desired result, but when I try to use this formula in the same column in which I have the data I am getting an error, maybe because I am not able to modify the formula as per my need.
I am attaching the excel sheet, were I have mentioned your formula in column other than A (in cell B2 highlighted in green color), but I want formula to work in the same data column that is in cell A2 highlighted in yellow color.
I tried using the formula with couple of modifications but failed, can you guide me, maybe I am missing on using it properly :(
- JamilMar 19, 2018Bronze ContributorIt does not work because of circular reference problem.
My formula range starts from A1 while you also want to use inside the same range.
To make this work you need to redefjne the starting row of your column A in the formula for example if your start of data starts from A4 then the modified formula should be
=COUNTBLANK(A$4:INDEX(A:A,SUMPRODUCT(MAX((A:A<>"")*ROW(A:A)))))
This should work.- Saurabh KhannaMay 05, 2018Copper Contributor
Hello Jamil -
Your suggestion worked for me to a great extent.
I was trying to post for last couple of days but was not able to post.
And I was using your listed suggestion for my work.
I have one small help again from you, attached is the excel sheet in which I am using your suggestion, however, I am able to use formula not in the same column in which count has to happen, I am able to use formula in cell other than column in which it is required.
For example, I have data in column A but formula I am able to use for Column A is in Column B.
Is it possible to use the formula in the same column in which the data is?
Thank you for your help.
Saurabh Khanna.