2

How can I find a count of blank cells until a value is found in a row?
I did some searching and found that I could use either
COUNTBLANK with INDIRECT or COUNTIF or MATCH with INDEX

But couldn't get it to work on any of them...

The formula should go into B5.
Example:

enter image description here

Thank you for the help.

ggmkp
  • 665
  • 3
  • 16
  • 27

3 Answers3

4

Use MATCH() Function:

=MATCH(FALSE,ISBLANK(B1:F1),0)-1

That formula will give you the number of cells to the first non-blank cell, so if you substract one you’ll get the number of blank cells. As is an array formula confirm it with CRTL+SHIFT+ENTER instead of ENTER so you get the brackets {} in the formula:

{=MATCH(FALSE,ISBLANK(B1:F1),0)-1}
Kaiser
  • 1,957
  • 1
  • 19
  • 28
0

Please try this basic Lookup function. (This is normal function which means no need to confirm CTRL+Shift+Enter.)

This below function needs to be written on A1 then you can drag it down.

=LOOKUP(2,1/($A1:G1<>""),COLUMN($A1:G1))-2
Mertinc
  • 793
  • 2
  • 13
  • 27
0

You can use a combination of MATCH and MAX (or MIN) for this:

enter image description here

Formula in B5:

=MATCH(MAX(B1:G1),B1:G1,0)-1

Drag down

JvdV
  • 70,606
  • 8
  • 39
  • 70