Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Counting word types in a cell

If the text below was contained in one cell in Excel, how do I count the
instances of say "PFD". If this can be done how do I then count for multiple
cells.


15-PR-11-PFD-001 REV.0A
15-PR-13-PFD-001 REV.0A
15-PR-17-PFD-002 REV.0A
15-PR-18-PFD-001 REV.0A
15-PR-11-PID-014 REV.0A
15-PR-11-PID-022 REV.1A
15-PR-11-PID-023 REV.1A
15-PR-17-PID-003 REV.1A
15-PR-13-PID-029 REV.1A
15-PR-11-PID-030 REV.1A

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Counting word types in a cell

Is each of those lines (like: 15-PR-11-PFD-001 REV.0A) in a single cell?

Or is it a bunch of that stuff in a single cell?

If your data was in column A, then these will count the number of cells with at
least 1 pfd in it:
=countif(a:a,"*pfd*")
or
=countif(a:a,"*"&"pfd"&"*")
or if PFD was in a different cell:
=countif(a:a,"*"&b1&"*")

The asterisk is a wildcard and represents any number (including 0) of
characters.

===========
If that whole mess were in a single cell, you could count the number of PFD's in
that cell:

=(len(a1)-len(substitute(upper(a1),Upper("pfd"),"")))/len("pfd")

To count all the number of those PFD's, you could use:
=sumproduct((len(a1:a10)-len(substitute(upper(a1:a10),upper("pfd"),"")))
/len("pfd"))

You can't use the entire column unless you're using xl2007.

=substitute() is case sensitive. By wrapping both the original and string with
=upper(), the formula counts all the PFD's--upper/lower/combination case.




Wes_SA wrote:

If the text below was contained in one cell in Excel, how do I count the
instances of say "PFD". If this can be done how do I then count for multiple
cells.

15-PR-11-PFD-001 REV.0A
15-PR-13-PFD-001 REV.0A
15-PR-17-PFD-002 REV.0A
15-PR-18-PFD-001 REV.0A
15-PR-11-PID-014 REV.0A
15-PR-11-PID-022 REV.1A
15-PR-11-PID-023 REV.1A
15-PR-17-PID-003 REV.1A
15-PR-13-PID-029 REV.1A
15-PR-11-PID-030 REV.1A


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Counting word types in a cell

Dave

Thanks very much, solved my problem in one shot.

Regards

Wes_SA

"Dave Peterson" wrote:

Is each of those lines (like: 15-PR-11-PFD-001 REV.0A) in a single cell?

Or is it a bunch of that stuff in a single cell?

If your data was in column A, then these will count the number of cells with at
least 1 pfd in it:
=countif(a:a,"*pfd*")
or
=countif(a:a,"*"&"pfd"&"*")
or if PFD was in a different cell:
=countif(a:a,"*"&b1&"*")

The asterisk is a wildcard and represents any number (including 0) of
characters.

===========
If that whole mess were in a single cell, you could count the number of PFD's in
that cell:

=(len(a1)-len(substitute(upper(a1),Upper("pfd"),"")))/len("pfd")

To count all the number of those PFD's, you could use:
=sumproduct((len(a1:a10)-len(substitute(upper(a1:a10),upper("pfd"),"")))
/len("pfd"))

You can't use the entire column unless you're using xl2007.

=substitute() is case sensitive. By wrapping both the original and string with
=upper(), the formula counts all the PFD's--upper/lower/combination case.




Wes_SA wrote:

If the text below was contained in one cell in Excel, how do I count the
instances of say "PFD". If this can be done how do I then count for multiple
cells.

15-PR-11-PFD-001 REV.0A
15-PR-13-PFD-001 REV.0A
15-PR-17-PFD-002 REV.0A
15-PR-18-PFD-001 REV.0A
15-PR-11-PID-014 REV.0A
15-PR-11-PID-022 REV.1A
15-PR-11-PID-023 REV.1A
15-PR-17-PID-003 REV.1A
15-PR-13-PID-029 REV.1A
15-PR-11-PID-030 REV.1A


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting number of times a specific word appears in a single cell Ken Curtis Excel Discussion (Misc queries) 19 June 16th 09 05:34 AM
Excel 2007 error "some chart types cannot be combined with other chart types. Select a different chart types" roadsidetree Charts and Charting in Excel 15 June 2nd 09 10:53 AM
Counting different workinghour types Wanderer Excel Worksheet Functions 2 April 1st 07 08:22 PM
Counting the number of Error Types Bob Excel Worksheet Functions 3 November 16th 06 06:01 PM
Mixed data types in a cell camell Excel Discussion (Misc queries) 2 March 8th 06 08:36 PM


All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"