klatlap

Well-known Member
I have this formula that another user here created for me, basically it counts cells between 2 reference points, just wondering how i may have it just count the non blank cells.

=IF(Data!AS1="","",MATCH("?*",INDEX(Data!AS:AS,1+MATCH(Data!AT1,Data!AS:AS,0)):Data!AS\$1048576,0))

Excel Facts

Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Not sure how that is counting anything? Match returns the (1st) position of a criteria a range, it does not count.

If you need to count stuff, take a look at using the COUNTIFS() function - it counts all non-blank cells...
=countif(range1,criteria1, range2, criteria2..........................)

As you can see with columns A:C the formula in column C works fine

=IF(A1="","",IF(A1="end","",MATCH("?*",INDEX(A:A,1+MATCH(B1,A:A,0)):A\$1048576,0)))

But what i need is for the same result in column H, i have just given the example in H of what i need using the data in Columns F:G

Excel 2010
ABCDEFGH
1test1test15test1test14
3data
6test2test24test2test23
9data
10test3test33test3test33
13endend
Sheet1

Try this, copied down to the end of the data in column G.

Excel Workbook
FGH
1test1test14
2data
3
4data
5data
6test2test23
7data
8data
9
10test3test33
11data
12data
13end
Count

Your formula looks to simple, yet it works better than the original, ty

Oops, sorry i should have said that there is formulas in row G so your COUNTA is also counting them even if they are blank

Oops, sorry i should have said that there is formulas in row G so your COUNTA is also counting them even if they are blank
In that case try this in H1

=IF(F1="","",COUNTIF(G1:G\$13,"?*")-SUM(H2:H\$13))

Ty, works a treat

Ty, works a treat
You are welcome. This would also still work for the original question as well.

Replies
9
Views
373
Replies
3
Views
259
Replies
2
Views
286
Replies
6
Views
200
Replies
1
Views
164

1,203,453
Messages
6,055,533
Members
444,794
Latest member
HSAL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back