LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 1
Default Counting one Character as a String

Hi I am new to excel and have a problem I would really love help with.

I have multiple characters in one cell separated by spaces. I am trying to count the number of times the letter B appears by itself and not next to any other letter.

eg my data is like: B2 B4 B6 DR1 DR2 DR3 DPB1 DPB2

I only want to count B by itself (ie this would be 3 in above string)

I have used the array formula:
=SUM(LEN(K2)-LEN(SUBSTITUTE(K2,"B","")))/LEN("B")

This works great for all other letters but because I have B and DPB, I get a count of both of these. However, the array formula does work for the DPB entries as I just input "DP".

Is there a clever person out there that can help!!!
 
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 No of character in a string Chandrashekar B Excel Worksheet Functions 1 October 28th 09 06:44 AM
Counting specific character in text string Bob Excel Worksheet Functions 3 January 18th 07 08:44 PM
counting instances of a character within a string mikelee101[_3_] Excel Programming 5 December 19th 05 04:40 AM
Counting number of time a character appears in a string Henrik Excel Worksheet Functions 5 October 20th 05 11:00 PM
Function to return Character Position of Xth character within a string Andibevan[_2_] Excel Programming 4 June 9th 05 03:24 PM


All times are GMT +1. The time now is 11:21 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"