Counting formula results and text data while ignoring blank cells

Darren_workforce

Board Regular
Joined
Oct 13, 2022
Messages
146
Office Version
  1. 365
Platform
  1. Windows
Hello,

Column i has a macro that I grabbed online to count colored cells. For the purposes of this inquiry, I believe it's irrelevant but let me know if it will help. C:G results come from a replication formula (see C2 below reference for example). However, Column H are all manually data entered names with no formulas.

My formulas in K do not appear to be counting accurately. I've tried the below formulas and also attempted to use COUNTBLANK formulas but no matter what, it's not adding correctly. What I'd like is to have K tally up the number of names that are returned from both the IF(ISBLANK...) formulas as well as the data entered cells in H while at the same time, ignoring the blank cells that did not return a name. Once it adds up the number of names that appear, it then adds that total to the total from the above cell for a running total. K2:K4 are correct but Row 5 is where the calculation begins to go astray. Any help is greatly appreciated.

C2 formula:
Excel Formula:
=IF(ISBLANK(M7),"",M7)]
K2 formula:
Excel Formula:
=(COUNTA(C2:H2)-COUNTIF(C2:H2,""))
K3 formula:
Excel Formula:
=(COUNTA(C3:H3)-COUNTIF(C3:H3,""))+K2

A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
1DayDateAgentsRunning Rep CountCompliant %returned resultsshould be:
2M5/6/2024HaleyDebbieMarySarahCharles4/55
3T5/7/2024DanMichelleMaxElizabeth4/99
4W5/8/2024RyanRobinBrittanyShelley4/1313
5R5/9/2024TerranceJenniferWhitneyAlice4/1617
6F5/10/2024GaryAlexKimWandaLisa4/2022
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hello. Try this.
Mappe6
KL
1returned resultsshould be:
255
399
41313
51717
62222
Tabelle1
Cell Formulas
RangeFormula
K2K2=COUNTA(TEXTSPLIT(TEXTJOIN(" ",TRUE,C2:H2)," "))
K3:K6K3=COUNTA(TEXTSPLIT(TEXTJOIN(" ",TRUE,C3:H3)," "))+K2
 
Upvote 0
K2: =COUNTIF(C2:H2,"?*")
K3: =COUNTIF(C3:H3,"?*")+K2
Copy down.
 
Upvote 0
Hello. Try this.
Mappe6
KL
1returned resultsshould be:
255
399
41313
51717
62222
Tabelle1
Cell Formulas
RangeFormula
K2K2=COUNTA(TEXTSPLIT(TEXTJOIN(" ",TRUE,C2:H2)," "))
K3:K6K3=COUNTA(TEXTSPLIT(TEXTJOIN(" ",TRUE,C3:H3)," "))+K2
This appeared to work properly for a couple rows but then at row 9, it added an extra item even though there was none. After breaking down the formula, it appears because I added last initials on a couple names (same first names) it was creating a special count item for the initial. By removing the space between the first name and last initial, this formula works exactly as desired. Is there a way to take into account for the space if that is left in there?
 
Upvote 0
Replace the " " with a character that is not part of a text entry.
Excel Formula:
=COUNTA(TEXTSPLIT(TEXTJOIN("#",TRUE,C2:H2),"#"))
 
Upvote 0
Replace the " " with a character that is not part of a text entry.
Excel Formula:
=COUNTA(TEXTSPLIT(TEXTJOIN("#",TRUE,C2:H2),"#"))
OK simple enough! That takes care of everything I was looking to do. Thank you very much for your help on this request!!
 
Upvote 0
Replace the " " with a character that is not part of a text entry.
Excel Formula:
=COUNTA(TEXTSPLIT(TEXTJOIN("#",TRUE,C2:H2),"#"))
In theory, I may have spoken too soon. I generated a blank row using the
Excel Formula:
=IF(ISBLANK(M7),"",M7)
populating the row and then
Excel Formula:
=COUNTA(TEXTSPLIT(TEXTJOIN("#",TRUE,C2:H2),"#"))
at the end to count up everything.

With all 5 cells in the row "blank", the formula is still providing a result of '1' instead of '0'. Would you know why?
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,173
Members
452,615
Latest member
bogeys2birdies

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