COUNTIF Ignoring Hidden Rows

Jambo2000

New Member
Joined
Jul 17, 2020
Messages
10
Platform
  1. Windows
Very New to Excel - Please go easy on me ;)

I'm putting together a spreadsheet to store and monitor TASKS
Each TASK will have smaller ACTIONS to go along with it. I have set the sheet so that once all the ACTIONS are 100% done, the TASK is also marked as 100% done.
I've created a tally at the top for both the total TASKS and the total ACTIONS.

Each TASK has been populated with 10 rows of ACTIONS.
As not every TASK will need all 10 ACTIONS, the rows not used will be hidden. Issue i have is the formula i'm using to count the total ACTIONS is : =COUNTIF(A7:A1000,"Action*")
This counts the total even if the row is hidden. Looking around on Google, you can't seem to have something that both ignores the hidden rows and uses the COUNTIF

Struggling to find a work around - Please help
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Chaozfate

Board Regular
Joined
Mar 15, 2017
Messages
58
Hi, try this assuming your range is A:A

=SUMPRODUCT((A:A="Action")*(SUBTOTAL(103,OFFSET(A1,ROW(A:A)-MIN(ROW(A:A)),0))))
 

Jambo2000

New Member
Joined
Jul 17, 2020
Messages
10
Platform
  1. Windows

ADVERTISEMENT

Hi, try this assuming your range is A:A

=SUMPRODUCT((A:A="Action")*(SUBTOTAL(103,OFFSET(A1,ROW(A:A)-MIN(ROW(A:A)),0))))

Hi Chaozfate,

Thank you kindly. That certainly did get me closer than previously. When I entered the formula, I had a result of 1
I currently have 70 TASKS in the spread sheet and each has 10 ACTIONS. So the total visible ACTIONS is 700. All appear in Column A

Was therefore expecting a result of 700 that reduced as i hid some rows.
Tried making a few adjustments but yet again i think i just lack in knowledge to understand and adjust as required.

Any further help is appriciated
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,203
Office Version
  1. 365
Platform
  1. Windows
How about
=SUMPRODUCT((LEFT(A1:A30,6)="Action")*(SUBTOTAL(103,OFFSET(A1,ROW(A1:A30)-MIN(ROW(A1:A30)),0))))

It's always best to avoid whole column references, especially in array formulae.
 

Jambo2000

New Member
Joined
Jul 17, 2020
Messages
10
Platform
  1. Windows

ADVERTISEMENT

How about
=SUMPRODUCT((LEFT(A1:A30,6)="Action")*(SUBTOTAL(103,OFFSET(A1,ROW(A1:A30)-MIN(ROW(A1:A30)),0))))

It's always best to avoid whole column references, especially in array formulae.

Hi Fluff,

With an adjustment to the row numbers that worked a treat - thank you so much!!!!
Can i assume that if i add rows i'd have to adjust that formula manually? (this was why i had been hopeful i could do an entire column)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,203
Office Version
  1. 365
Platform
  1. Windows
You can use it on an entire column, but it is likely to slow things down.
If you convert your data into a table, then you can use this

+Fluff New.xlsm
ABCD
1ActionsTasks17
3Action2
4Action3
5Action4
7Action6
8Action7
10Action9
11Action10
12Action11
14Action13
15Action14
21Action20
22Action21
23Action22
27Action26
28Action27
29Action28
30Action29
Data
Cell Formulas
RangeFormula
D1D1=SUMPRODUCT((LEFT(Table1[Actions],6)="Action")*(SUBTOTAL(103,OFFSET(A1,ROW(Table1[Actions])-MIN(ROW(Table1[Actions])),0))))

and the range will adjust to the table.
 

Jambo2000

New Member
Joined
Jul 17, 2020
Messages
10
Platform
  1. Windows
You can use it on an entire column, but it is likely to slow things down.
If you convert your data into a table, then you can use this

+Fluff New.xlsm
ABCD
1ActionsTasks17
3Action2
4Action3
5Action4
7Action6
8Action7
10Action9
11Action10
12Action11
14Action13
15Action14
21Action20
22Action21
23Action22
27Action26
28Action27
29Action28
30Action29
Data
Cell Formulas
RangeFormula
D1D1=SUMPRODUCT((LEFT(Table1[Actions],6)="Action")*(SUBTOTAL(103,OFFSET(A1,ROW(Table1[Actions])-MIN(ROW(Table1[Actions])),0))))

and the range will adjust to the table.


Fluff,

Converting to Table didn't work and messed up all the columns and headers. Maybe there is a way to fix but such a newbie.
Would you mind letting me have a formula for the entire of column A and i can see how slow it goes

Appreciate the on going help!!! (love the profile picture BTW)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,203
Office Version
  1. 365
Platform
  1. Windows
To use full columns, just change the A1:A30 to A:A
 

Watch MrExcel Video

Forum statistics

Threads
1,123,129
Messages
5,599,898
Members
414,343
Latest member
JennyGarcia

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