COUNTA Range Exclude Formulas

ozbeachbum

Board Regular
Joined
Jun 3, 2015
Messages
159
Office Version
  1. 2021
Platform
  1. Windows
Hi All,
I am trying to count the number of non blank cells in 2 ranges and exclude formulas.
Attached is a sample sheet.
Any assistance would be greatly appreciated.

count not formula.xlsx
BCDE
2Current EntriesShould show: NO Current Entries
3
400
5
6
7
8
9
1000
11
12
13
14
15
1600
17
18
19
20
Sheet1
Cell Formulas
RangeFormula
B2B2=IF(AND(COUNTA(B4:B20,C4:C20))>0,"Current Entries","No Current Entries")
B16:C16,B10:C10,B4:C4B4=COUNTA(B5:B8)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:C2Expression=$B$2="Current Entries"textNO
C16Cell Value>0textNO
B16Cell Value>0textNO
C10Cell Value>0textNO
C4Cell Value>0textNO
B10Cell Value>0textNO
B4Cell Value>0textNO
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
This will do what you are asking. Note that this is done in Office 365. If you are still using Excel 2010 as shown on your profile then you may need to array confirm the formula using Ctrl Shift Enter. If this is the case then you would need to unmerge B2:C2 first as you can not enter an array formula in a merged cell.
Book1
BCDE
2No Current EntriesShould show: NO Current Entries
3
400
5
6
7
8
9
1000
11
12
13
14
15
1600
17
18
19
20
Sheet2
Cell Formulas
RangeFormula
B2B2=IF(COUNTA(B4:C20)-SUM(IFERROR(--(LEFT(FORMULATEXT(B4:C20),1)="="),0)),"Current Entries","No Current Entries")
B4:C4,B16:C16,B10:C10B4=COUNTA(B5:B8)
 
Upvote 0
Hi Jason,
Thanks for your reply.
I tried both array as suggested and non array, and in both instances the result is still returning Current Entries.
Any suggestions?
I have reattached the worksheet with your formula.
Cheers,
Dave.

count not formula.xlsx
BCDEFG
2Current EntriesShould show: NO Current Entries
3
400Current EntriesNon Array
5
6Current EntriesArray
7
8
9
1000
11
12
13
14
15
1600
17
18
19
20
Sheet1
Cell Formulas
RangeFormula
B2B2=IF(COUNTA(B4:C20)-SUM(IFERROR(--(LEFT(FORMULATEXT(B4:C20),1)="="),0)),"Current Entries","No Current Entries")
B16:C16,B10:C10,B4:C4B4=COUNTA(B5:B8)
E4E4=IF(COUNTA(B4:C20)-SUM(IFERROR(--(LEFT(FORMULATEXT(B4:C20),1)="="),0)),"Current Entries","No Current Entries")
E6E6=IF(COUNTA(B4:C20)-SUM(IFERROR(--(LEFT(FORMULATEXT(B4:C20),1)="="),0)),"Current Entries","No Current Entries")
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:C2Expression=$B$2="Current Entries"textNO
C16Cell Value>0textNO
B16Cell Value>0textNO
C10Cell Value>0textNO
C4Cell Value>0textNO
B10Cell Value>0textNO
B4Cell Value>0textNO
 
Upvote 0
Try =FORMULATEXT(B4) in an empty cell, does that show you the COUNTA() formula, or a #NAME? error?

If it shown an error then that means your version of excel doesn't support the function that the formula needs. Without that one, I don't think it will be possible unless you use vba.
 
Upvote 0
Hi Jason,
It shows #NAME?
Thank you for all your effort.
Cheers,
Dave.
 
Upvote 0
When I looked at this initially, I was working on the basis that this
I am trying to count the number of non blank cells in 2 ranges and exclude formulas.
could mean any formula.

If you are only ever going to use things like simple counts as in your example then you could use either SUBTOTAL or AGGREGATE (aggregate has a few more options if needed).

I really need to stop overthinking things :oops:
Book1
BC
2No Current Entries
3
400
5
6
7
8
9
1000
11
12
13
14
15
1600
17
18
19
20
Sheet1
Cell Formulas
RangeFormula
B2B2=IF(SUBTOTAL(3,B4:C20),"Current Entries","No Current Entries")
B4:C4,B16:C16,B10:C10B4=SUBTOTAL(3,B5:B8)
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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
Back
Top