Counting formula results and text data while ignoring blank cells

Darren_workforce

Board Regular
Joined
Oct 13, 2022
Messages
136
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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
How is this not what you want?

Book1
ABCDEFGHIJK
1DayDateAgentsRunning Rep CountCompliant %returned results
2M5/6/2024HaleyDebbieMarySarahCharles4/5
3T5/7/2024DanMichelleMaxElizabeth4/9
4W5/8/2024RyanRobinBrittanyShelley4/13
5R5/9/2024TerranceJenniferWhitneyAlice4/17
6F5/10/2024GaryAlexKimWandaLisa4/22
Sheet1
Cell Formulas
RangeFormula
K2K2=COUNTIF(C2:H2,"?*")
K3:K6K3=COUNTIF(C3:H3,"?*")+K2
 
Upvote 0
Thank you. I tried that but if there's no data, it was populating a '0' so I tried to set it up to appear blank if that was the case.
That's not possible.
=M7 would do what you're saying.
=T(M7) would not.


Book1
MN
7 
Sheet1
Cell Formulas
RangeFormula
N7N7=T(M7)
 
Upvote 0
COUNTIF should work because all this does is count cells that have at least 1 character in them, thus eliminating blanks.
The '0' is still populating in the cell if the reference cell is blank. However, conditional formatting made those disappear and it didn't affect the overall formula. Apologies. I had COUNTIF in my original formula and I thought it was referencing merely the actual blank cells in my data and not the blank results of a formula. It does appear that works and does what I need in a simpler form while also accurately calculating blank rows. Thank you for sticking with me on this.
 
Upvote 0
Easier way to hide the 0 is to just format the cells as a custom number format of 0;;
 
Upvote 0

Forum statistics

Threads
1,216,109
Messages
6,128,883
Members
449,477
Latest member
panjongshing

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