Count and Extract

How_Do_I

Well-known Member
Joined
Oct 23, 2009
Messages
1,838
Office Version
  1. 2010
Platform
  1. Windows
In the following how would I count the cells that contain "Child Folder" and then extract that cell less the words "Child Folder" please?

The returns I'm after are in cells C1:C4.

Excel Workbook
ABC
1Child Folder: Cycling3
2Elham Valley Cycle Ride.pdfCycling
3Giro 2014.pdfWalks
4Miner's Way Cycle Map.pdfWar
5Child Folder: Walks
6Frontline Britain Trail Map.pdf
7
8Child Folder: War
9Bombing London - Unexploded Bombs.pdf
10fortitude.pdf
Sheet1
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Actually I've got my C2 downwards:

CSE: =TRIM(SUBSTITUTE(INDEX($A$1:$A$10,SMALL(IF(ISNUMBER(SEARCH("Child Folder",$A$1:$A$10)),ROW($A$1:$A$10)-ROW($A$1)+1),ROW(A1))),"Child Folder: ",""))

It's the count in C1 that I can't work out.
 
Upvote 0
Nevermind, already answered.
 
Last edited:
Upvote 0
Hi Aladin, I used the ROW(A1) as the k in SMALL purely out of laziness in a test workbook, I will be using the robust ROWS($A$2:A2) or something similar in my proper workbook.
 
Last edited:
Upvote 0
That said, in the Jeanie all my example finish with a ".pdf" file extension so I used:

CSE =IF(ROWS($K$2:K2)>$I$2,"",INDEX($A$1:$A$10,SMALL(IF(ISNUMBER(SEARCH(".pdf",$A$1:$A$10)),ROW($A$1:$A$10)-ROW($A$1)+1),ROWS($K$2:K2)))) to extract everything without "Child Folder". What could I use to extract when I have multiple file extensions? Will I need another IF(ISNUMBER(SEARCH(".jpeg",range) in my formula?
 
Upvote 0
@ How_Do_I

In I2 just enter:

=SUM(COUNTIFS($A$1:$A$11,"*"&{".pdf",".jpeg"}&"*"))

In K2 control+shift+enter, not just enter, and coy down:

=IF(ROWS($K$2:K2)>$I$2,"",INDEX($A$1:$A$11,SMALL(IF(MMULT(ISNUMBER(SEARCH(TRANSPOSE({".pdf";".jpeg"}),$A$1:$A$11))+0,{1;1}),ROW($A$1:$A$11)-ROW($A$1)+1),ROWS($K$2:K2))))
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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