Count and Extract

How_Do_I

Well-known Member
Joined
Oct 23, 2009
Messages
1,843
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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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