Formula Adjustment Needed.

klatlap

Well-known Member
Joined
Sep 1, 2004
Messages
597
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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

FDibbins

Well-known Member
Joined
Feb 16, 2013
Messages
6,723
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..........................)
 

klatlap

Well-known Member
Joined
Sep 1, 2004
Messages
597
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
2datadata
3data
4datadata
5datadata
6test2test24test2test23
7datadata
8datadata
9data
10test3test33test3test33
11datadata
12datadata
13endend
Sheet1
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
54,932
Office Version
  1. 365
Platform
  1. Windows
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
 

klatlap

Well-known Member
Joined
Sep 1, 2004
Messages
597

ADVERTISEMENT

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

klatlap

Well-known Member
Joined
Sep 1, 2004
Messages
597
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
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
54,932
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

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))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,653
Messages
5,854,963
Members
431,689
Latest member
jacker01

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top