ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Count occurance of multiple text criteria (https://www.excelbanter.com/excel-discussion-misc-queries/255757-count-occurance-multiple-text-criteria.html)

Sam.D

Count occurance of multiple text criteria
 
Im using the formula

=SUM(LEN(B2:B955)-LEN(SUBSTITUTE(B2:B955,"Pension","")))/LEN("Pension")

This works fine to count the number of occurances for the word Pension but
Im stuck when trying to count using multiple criteria eg the the Pension and
the word Scheme.

Any help is greatly appreciated.

Sam.D


Jacob Skaria

Count occurance of multiple text criteria
 
Try

=SUM(COUNTIF(B2:B955,{"*Pension*","*Scheme*"}))

OR for whole cell match
=SUM(COUNTIF(B2:B955,{"Pension","Scheme"}))


--
Jacob


"Sam.D" wrote:

Im using the formula

=SUM(LEN(B2:B955)-LEN(SUBSTITUTE(B2:B955,"Pension","")))/LEN("Pension")

This works fine to count the number of occurances for the word Pension but
Im stuck when trying to count using multiple criteria eg the the Pension and
the word Scheme.

Any help is greatly appreciated.

Sam.D


Sam.D

Count occurance of multiple text criteria
 
Thanks, works great, huge help.

Cheers

Sam.D

"Jacob Skaria" wrote:

Try

=SUM(COUNTIF(B2:B955,{"*Pension*","*Scheme*"}))

OR for whole cell match
=SUM(COUNTIF(B2:B955,{"Pension","Scheme"}))


--
Jacob


"Sam.D" wrote:

Im using the formula

=SUM(LEN(B2:B955)-LEN(SUBSTITUTE(B2:B955,"Pension","")))/LEN("Pension")

This works fine to count the number of occurances for the word Pension but
Im stuck when trying to count using multiple criteria eg the the Pension and
the word Scheme.

Any help is greatly appreciated.

Sam.D



All times are GMT +1. The time now is 11:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com