help me with COUNTA formula

rexcel3

New Member
Joined
Apr 16, 2022
Messages
46
Office Version
  1. 2021
Platform
  1. Windows
i have a table with information.

im using filter formula to show some data.

when using Friday and Exclude Dylan there is empty information in filter which is correct but counta formula is counting this as 1. why?

im using swedish excel so we use ; in formulas.

Filter:
excel.xlsx
BCDEFGH
2Choose dayFridayExcludeDylanAmount1
3LeverantörKonsultAtt göraDag 1Dag 2E-postStatus
4 
Veckorutiner
Cell Formulas
RangeFormula
H2H2=COUNTA(B4:B1000)
B4B4=IF(FILTER(attgöra_tabell6, ((attgöra_tabell6[Dag 1]=Veckorutiner!C2) + (attgöra_tabell6[Dag 2]=Veckorutiner!C2)) * (attgöra_tabell6[Konsult]<>Veckorutiner!E2), "")="", "", FILTER(attgöra_tabell6, ((attgöra_tabell6[Dag 1]=Veckorutiner!C2) + (attgöra_tabell6[Dag 2]=Veckorutiner!C2)) * (attgöra_tabell6[Konsult]<>Veckorutiner!E2), ""))
Cells with Data Validation
CellAllowCriteria
C2List=Dagar
E2List=Konsulter


Table:
excel.xlsx
BCDEFG
3LeverantörKonsultAtt göraDag 1Dag 2E-post
4xJacksfsMondayWednesdayaesvgv
5xxBlackafTuesdaygfvadgfdv
6xxxMichaeladfggThursdayagdfvgavf
7aDylanafgagfaMondayThursdayagvfagvf
8aaBlackadfgadgTuesdayagvfagvf
9aaaBlackafgadgTuesdayetynjujent
10sDylansfghjfshWednesdayt,oitli,
11ssDylanetyheythMondayy5wwy5
12sssHomersbhshbMondayTuesdaytq45qt
13dBlackshbgshgTuesdayeiuj7i7jre
14ddJackshbghsgbMondayWednesday8irok8rij
15dddDylansbhshbgFridayy5tw5y
16fJacksbghsgbMondayWednesdaytqqt
17ffMichaelshvshbThursdayue75jhu7e
18fffDylansbhgshbgThursdayWednesdayuh65u6h
19gRimasbhshbgWednesdayy6w4hwy64
20ggHomersbhshbgMondayTuesdayy56g4wyw5
21gggDylanayevyvaMondayThursdayywg5yw
22hDylanavy5eaveThursdaywy5g
23hhDylanavey5vaeyhFridaywyg5
Databas
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Your FILTER formula is returning a blank string, which COUNTA will count.

In simple terms:

AB
1 1
Sheet1
Cell Formulas
RangeFormula
A1A1=""
B1B1=COUNTA(A:A)
 
Upvote 0
Hi rexcel3,

Like StephenCrump wrote, your filter function, if empty, will return "" which is considered an empty element, but still an element. Your COUNTA will then count 1 element even if the element is "".

To prevent that, i would do something like: *I am using the French version of Excel 365, so there might be some errors due to manual translation or discrepancies in the Excel user manual*

Excel Formula:
=IF(B4 = "", 0, COUNTA(B4:B1000))

Bests regards,

Vincent
 
Upvote 0
Solution
In Excel 2021, you should be able to use this in H2
Excel Formula:
=SUM(--(INDEX(B4#,0,1)<>""))
Where B4# is the SPILL range and the Index function gets just the first column of the SPILL range.

Note: Like CountA the CountIfs category of formulas will include "" even if you use "<>"
 
Upvote 0
Hi rexcel3,

Like StephenCrump wrote, your filter function, if empty, will return "" which is considered an empty element, but still an element. Your COUNTA will then count 1 element even if the element is "".

To prevent that, i would do something like: *I am using the French version of Excel 365, so there might be some errors due to manual translation or discrepancies in the Excel user manual*

Excel Formula:
=IF(B4 = "", 0, COUNTA(B4:B1000))

Bests regards,

Vincent
thank u, this solved my issue.

=OM(B4 = ""; 0;ANTALV(B4:B1000))
 
Upvote 0

Forum statistics

Threads
1,225,730
Messages
6,186,698
Members
453,369
Latest member
positivemind

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