Is it possible (with a formula preferably) to count the number of blank cells in row, where the counting starts at a given column and counts going backward (e.g. right to left) the number of blank cells until a non-blank cell is found? In the example below, the counting begins at Column H and proceeds leftward. Using COUNTA
or COUNTIF
seem like reasonable tools to use, but I am unsure on how to terminate the counting once a non-blank cell is found.
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
- DoCmd.TransferSpreadsheet is not recognizing works
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
- How to create a hyperlink to a different Excel she
You could use nested if statements
You can use something like this if the values in your table are all text:
MATCH("zzzz",B2:H2)
returns the column number in which the last non-blank cell is.CHAR(97+ column number)
returns the letter of that column.Append it to the row number to give the reference where the
COUNTBLANK
has to start with&ROW()
&":H"&ROW())
gives the reference of the last cell, which isH
plus the row number.INDIRECT
turns the concatenated text into a range that Excel can evaluate.Try this formula
=COLUMNS(B2:H2)-MATCH("zzzz",B2:H2)